diff --git a/xisdnload/XISDNLoad.ad b/xisdnload/XISDNLoad.ad index 3f12e2c2..e3cfdab1 100644 --- a/xisdnload/XISDNLoad.ad +++ b/xisdnload/XISDNLoad.ad @@ -1,15 +1,16 @@ XISDNLoad.geometry: 250x100 *Label*Justify: left -*Label*Label: %7s %3d:%02d %4.0fcps %ldkB - %-100s +! *Label*Label: %7s %3d:%02d %4.0fcps %ldkB - %-100s +*Label*Label: %7s %3d:%02d %4.0fcps %ldkB ! *minScale: 8 -*minScale: 1 +*minScale: 2 *JumpScroll: 1 *update: 1 *internalBorderWidth: 0 *showGrip: FALSE *onlineColor: red *tryingColor: yellow -*activeColor: green -! *activate: sudo route add default dev isdn2 & -! *deactivate: sudo route del default ; root isdnctrl hangup isdn2 & +*activeColor: lightgreen +*activate: /etc/isdn/xisdnload-netup & +*deactivate: /etc/isdn/xisdnload-netdown & *number: .* diff --git a/xisdnload/xisdnload-netdown b/xisdnload/xisdnload-netdown new file mode 100644 index 00000000..7f23446f --- /dev/null +++ b/xisdnload/xisdnload-netdown @@ -0,0 +1,21 @@ +#!/bin/sh + +# Example netdown script for xmonisdn +# Do with it what you want. + +# Note that xisdnload looks at the routing table to determine if a connection +# is "up" or not: +# - if there is _ANY_ route to an isdn or ippp interface, clicking on xisdnload +# will cause the netdown script to be run. +# - if there is _NO_ route to any isdn or ippp interface, clicking on xisdnload +# will cause the netup script to be run. +# +# As the example netdown script only hangs up the connection (and leaves the +# routes alone), another click will simply try to hang up again (i.e. run this +# script again). So, putting "isdnctrl dialmode all off" here is not that +# useful, as you have to do "isdnctrl dialmode all auto" manually... + +# Feel free to modify the scripts so that the routes are deleted and added. + +egrep -s '^ i(sdn|ppp)' /proc/net/dev > /dev/null || exit 0 +/usr/sbin/isdnctrl hangup ippp0 > /dev/null diff --git a/xisdnload/xisdnload-netup b/xisdnload/xisdnload-netup new file mode 100644 index 00000000..c4c1e0b7 --- /dev/null +++ b/xisdnload/xisdnload-netup @@ -0,0 +1,18 @@ +#!/bin/sh + +# Example netup script for xisdnload +# Do with it what you want. + +# Note that xisdnload looks at the routing table to determine if a connection +# is "up" or not: +# - if there is _ANY_ route to an isdn or ippp interface, clicking on xisdnload +# will cause the netdown script to be run. +# - if there is _NO_ route to any isdn or ippp interface, clicking on xisdnload +# will cause the netup script to be run. +# +# As the example netdown script only hangs up the connection (and leaves the +# routes alone), another click will simply try to hang up again. So, this +# netup script will never be executed... +# Feel free to modify the scripts so that the routes are deleted and added. + +exit 0