With a fresh system if you run
- Code: Select all
/sbin/ifdown eth0
- Code: Select all
/sbin/ifconfig
After that create the script that runs /sbin/ifdown eth0, call it something (I prefer something other than ifdown), place it in your PATH, which might include ~/bin if you have added that to your path. Then run the script by running it in a terminal, as root. Then you will know the script works.
Then you can set up an icon/launcher to run your script. You probably should change the script to run either
- Code: Select all
sudo /sbin/ifdown eth0
- Code: Select all
su -c /sbin/ifdown eth0
You could also use one of the many tools, such as wicd, which provide such functionality.