*************************************************************************** ** GADSLBUTTON : a GTK based ADSL monitor by Kees Lemmens, Jul. 2003 ** ** Version : 1.0 ** ** inspired by the old isdnbutton program written in 1996 by M. Gutschke.** ** Email: C.W.J.Lemmens@ewi.tudelft.nl ** *************************************************************************** This program monitors the state of an ADSL connection (impossible, down, up) and shows it in a traffic light. It also allows changing the state by clicking the traffic light icon. Differences with isdnbutton : - GTK based, not Xtoolkit based - monitors both /proc/net/route and /proc/net/dev, which allows for detailed information about the different states - does not run suid : start it from the DisplayManager*setup: script for gdm, kdm or xdm if you need to run as root. - can monitor a subrange of eth? devices, alllowing the use of more than one adslbutton, each monitoring it's own uplink. Install ======= Starting the button at boottime when starting up the Display Manager ensures it always runs as root without the need for any suid bits that may compromise security. This is done as follows : - Compile the button : simply typing "make" should do the trick. - cp gadslbutton to eg /usr/local/sbin or whereever you want it. - Find out which commands you use to establish and disconnect an ADSL connection. Often something like "dhcpcd", and "killall dhcpcd". - Look in /etc/X11/xdm-config for the display manager startup script. It contains something like : DisplayManager._0.setup: /usr/X11R6/lib/X11/xdm/Xsetup_0 - Add the following lines to Xsetup_0 : xhost +localhost /usr/local/sbin/gadslbutton \ -g ++ \ -l \ -u \ -d \ -s \ -e \ .... sleep 1 # give button time to come up, especially on fast systems xhost -localhost - Restart the Xserver (CTRL-ALT-BACKSPACE) and see if the button appears at the right position and with the right label. Usage ===== The meaning of traffic light colors is as follows : red = no ADSL (eth) devices configured yellow = Device for ADSL (eth?) exists, but there is no active connection green = Default route over ADSL device (eth?) exists, active connection - If the traffic light is red there are no ethernet devices and there is something werong with either the hardware or the drivers. - If the traffic light is green, a mouse click will execute the stopadsl script/command. - If the traffic light is yellow a mouse click will execute the startadsl script/command. - If you want to use the -e and -s options to have more than one button on the screen, it is important that each connection uses it's OWN eth device. Example : xhost +localhost /opt/sbin/adslbutton \ -u /opt/sbin/startadsl-line0 \ -d "/opt/sbin/stopadsl-line0" \ -l "ADSL line 0" \ -s 0 -e 0 \ -geometry +945+0 & /opt/sbin/adslbutton \ -u /opt/sbin/startadsl-line1 \ -d "/opt/sbin/stopadsl-line1" \ -l "ADSL line 1" \ -s 1 -e 1 \ -geometry +945+95 & sleep 1 # give isdnbutton some time to come up xhost -localhost Also make sure that the startup script uses the right device or else it is possible that each button monitors the state of both lines ! Startup options : ================= -u : network up cmd (def: /sbin/dhcpcd &) -d : network down cmd (def: /bin/killall dhcpcd &) -l : set label text (def: ADSL) -s : first eth? device to monitor (def: 0) -e : last eth? device to monitor (def: 8) -g <+x+y> : initial desktop position (def: +0+0) Note : the -geometry option only allows for a position, not for window size and it also doesn't allow negative values (which is allowed in Xtoolkit).