*************************************************************************** ** GISDNBUTTON : a GTK based ISDN monitor by Kees Lemmens, Dec. 2001 ** ** Version : 1.1 ** ** inspired by the old isdnbutton program written in 1996 by M. Gutschke.** *************************************************************************** This program monitors the state of an ISDN connection (down, pending, incoming, outgoing) 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 /dev/isdninfo, which allows more detailed information about the different states - distinguishes between incoming (blue) and outgoing (green) connections - 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 ippp devices, alllowing the use of more than one isdnbutton, 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 gsidnbutton to eg /usr/local/sbin or whereever you want it. - Find out which commands you use to establish, hangup and disconnect an ISDN connection. Often something like "startisdn", "isdnctrl hangup ippp?" and "stopisdn". - 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/gisdnbutton \ -g ++ \ -l \ -u \ -d \ -s \ -e \ -h & .... 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 ISDN (ippp) devices configured yellow = Route for ISDN (ippp) devices exist, but no active connection green = ISDN (ippp) devices available, active OUTGOING connection blue = ISDN (ippp) devices available, active INCOMING connection - If the traffic light is red, a mouse click will execute the startisdn script/command. - If the traffic light is green or blue, a mouse click will execute the isdnhangup script/command. - If the traffic light is yellow a mouse click will execute the stopisdn 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 ippp device. Example : xhost +localhost /opt/sbin/isdnbutton \ -u /opt/sbin/startisdn-line0 \ -h "/opt/sbin/isdnctrl hangup ippp0" \ -l "ISDN line 0" \ -s 0 -e 0 \ -geometry +945+0 & /opt/sbin/isdnbutton \ -u /opt/sbin/startisdn-line1 \ -h "/opt/sbin/isdnctrl hangup ippp1" \ -l "ISDN 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: /opt/sbin/startisdn &) -d : network down cmd (def: /opt/sbin/stopisdn &) -h : network hangup cmd (def: /opt/sbin/isdnctrl hangup ippp0 &) -l : set label text (def: ISDN) -s : first ippp device to monitor (def: 0) -e : last ippp device to monitor (def: MAX_ISDN_CHANNELS) -g <+x+y> : initital 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).