summaryrefslogtreecommitdiff
path: root/target/linux/lantiq/base-files/etc/hotplug.d/button
diff options
context:
space:
mode:
authorblogic <blogic@3c298f89-4303-0410-b956-a3cf2f4a3e73>2011-11-12 23:39:56 +0000
committerblogic <blogic@3c298f89-4303-0410-b956-a3cf2f4a3e73>2011-11-12 23:39:56 +0000
commit1efd56db6ceeeae30398d5d85a152affdca1bc15 (patch)
tree2fcdcb73ceac5a43fd5fbf00f0c5f0cde1269154 /target/linux/lantiq/base-files/etc/hotplug.d/button
parent4919aff42f3bdcc0f4cff97077be217cb1613031 (diff)
lantiq: adds hotplug handler for handling buttons and makes w303v work with it
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@28999 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/lantiq/base-files/etc/hotplug.d/button')
-rw-r--r--target/linux/lantiq/base-files/etc/hotplug.d/button/10-generic.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/target/linux/lantiq/base-files/etc/hotplug.d/button/10-generic.sh b/target/linux/lantiq/base-files/etc/hotplug.d/button/10-generic.sh
new file mode 100644
index 0000000000..b2fdda23f8
--- /dev/null
+++ b/target/linux/lantiq/base-files/etc/hotplug.d/button/10-generic.sh
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+[ "${ACTION}" = "released" ] || exit 0
+
+. /lib/functions.sh
+
+case "${BUTTON}" in
+ BTN_0)
+ logger "reset pressed"
+ sync
+ reboot
+ ;;
+ BTN_1)
+ logger "factory pressed"
+ jffs2_mark_erase "rootfs_data"
+ sync
+ reboot
+ ;;
+ *)
+ logger "unknown button ${BUTTON}"
+ ;;
+esac