diff options
author | Felix Fietkau <nbd@openwrt.org> | 2006-11-04 00:21:54 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2006-11-04 00:21:54 +0000 |
commit | 8cc785bdf6493ae87bc9f9cf67f35a6dea36af49 (patch) | |
tree | 26515de27827ae060e939356ea2af47f43465ff0 /package/comgt/files/3g.button | |
parent | ab80113a68fe01e6a7c53b6465e44c8523589119 (diff) | |
download | upstream-8cc785bdf6493ae87bc9f9cf67f35a6dea36af49.tar.gz upstream-8cc785bdf6493ae87bc9f9cf67f35a6dea36af49.tar.bz2 upstream-8cc785bdf6493ae87bc9f9cf67f35a6dea36af49.zip |
move comgt to trunk and add network scripts for umts compatible with the wrt54g3g
SVN-Revision: 5433
Diffstat (limited to 'package/comgt/files/3g.button')
-rw-r--r-- | package/comgt/files/3g.button | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/package/comgt/files/3g.button b/package/comgt/files/3g.button new file mode 100644 index 0000000000..54997d870a --- /dev/null +++ b/package/comgt/files/3g.button @@ -0,0 +1,35 @@ +button_action() {( + # use led for keeping track of the state + case "$(cat /proc/diag/led/3g_green)" in + 1) + ifdown "$1" + ifup wan + ;; + 0) + ifdown wan + ifup "$1" + ;; + esac +)} + +[ "$ACTION" = "released" -a "$BUTTON" = "3g" ] && { + (echo /bin/true > /proc/sys/kernel/hotplug) + + include /lib/network + scan_interfaces + config_cb() { + config_get TYPE "$CONFIG_SECTION" TYPE + case "$TYPE" in + interface) + config_get proto "$CONFIG_SECTION" proto + config_get button "$CONFIG_SECTION" button + case "$button" in + 1|on|enabled) [ "$proto" = "3g" ] && button_action "$CONFIG_SECTION";; + esac + ;; + esac + } + config_load network + + (echo /sbin/hotplug > /proc/sys/kernel/hotplug) +} & |