Skip to content

Instantly share code, notes, and snippets.

@padenot
Created March 17, 2011 20:48
Show Gist options
  • Save padenot/875097 to your computer and use it in GitHub Desktop.
Save padenot/875097 to your computer and use it in GitHub Desktop.
Du blocage de l'internet pendant quelque minutes, ou comment gagner en productivité
#!/bin/sh
time=$(zenity --text="On bloque le net combien de temps ?" --scale --value=60 --min-value=1 --max-value=600)
echo $time
network_interface=$(ifconfig | grep Link | tr -s ' ' | cut -d ' ' -f1)
for i in $network_interface
do
if [ $i != "lo" ]
then
ifconfig $i down
fi
done
sleep $time
for i in $network_interface
do
ifconfig $i up
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment