I added a button to my Tint2 taskbar where if I left click it, it will disable (change the ethernet to down) it and if I right click, it will change the network to UP.
The command for the button I am using is this:
Basically I am launching xterm to run SU and upon succesful password then change network to up or down. Is the code above good? So far it works, but is there better code? ifconfig command can only be run as root? (I am using a realtek ethernet hence re0).
The command for the button I am using is this:
xterm -title "re0 DOWN" -e su root -c "ifconfig re0 down"
xterm -title "re0 UP" -hold -e su root -c "ifconfig re0 up"
Basically I am launching xterm to run SU and upon succesful password then change network to up or down. Is the code above good? So far it works, but is there better code? ifconfig command can only be run as root? (I am using a realtek ethernet hence re0).