aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files/files/etc/rc.button
diff options
context:
space:
mode:
authorJames <>2013-03-17 12:16:37 +0000
committerJames <>2013-03-17 12:16:37 +0000
commit27b76ab0671089c47506615a796a261e993896a7 (patch)
tree61213d67e7fa87b20356b23798558e2c4212c42f /package/base-files/files/etc/rc.button
downloadtrunk-36060-master.tar.gz
trunk-36060-master.tar.bz2
trunk-36060-master.zip
Diffstat (limited to 'package/base-files/files/etc/rc.button')
-rw-r--r--package/base-files/files/etc/rc.button/.svn/entries130
-rw-r--r--package/base-files/files/etc/rc.button/.svn/prop-base/failsafe.svn-base5
-rw-r--r--package/base-files/files/etc/rc.button/.svn/prop-base/reset.svn-base5
-rw-r--r--package/base-files/files/etc/rc.button/.svn/prop-base/rfkill.svn-base5
-rw-r--r--package/base-files/files/etc/rc.button/.svn/text-base/failsafe.svn-base2
-rw-r--r--package/base-files/files/etc/rc.button/.svn/text-base/reset.svn-base18
-rw-r--r--package/base-files/files/etc/rc.button/.svn/text-base/rfkill.svn-base23
-rwxr-xr-xpackage/base-files/files/etc/rc.button/failsafe2
-rwxr-xr-xpackage/base-files/files/etc/rc.button/reset18
-rwxr-xr-xpackage/base-files/files/etc/rc.button/rfkill23
10 files changed, 231 insertions, 0 deletions
diff --git a/package/base-files/files/etc/rc.button/.svn/entries b/package/base-files/files/etc/rc.button/.svn/entries
new file mode 100644
index 0000000..5af1bb6
--- /dev/null
+++ b/package/base-files/files/etc/rc.button/.svn/entries
@@ -0,0 +1,130 @@
+10
+
+dir
+36060
+svn://svn.openwrt.org/openwrt/trunk/package/base-files/files/etc/rc.button
+svn://svn.openwrt.org/openwrt
+
+
+
+2013-03-13T18:11:19.892934Z
+36003
+blogic
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3c298f89-4303-0410-b956-a3cf2f4a3e73
+
+reset
+file
+
+
+
+
+2013-03-17T12:13:21.000000Z
+b003e4351c706679936b223b8c0bf036
+2013-03-13T18:11:19.892934Z
+36003
+blogic
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+277
+
+rfkill
+file
+
+
+
+
+2013-03-17T12:13:21.000000Z
+581e09365e2fd825aae743ab5e811513
+2013-03-13T18:11:19.892934Z
+36003
+blogic
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+413
+
+failsafe
+file
+
+
+
+
+2013-03-17T12:13:21.000000Z
+073ed7a5c2da53d10353ba67f2babdc5
+2013-03-13T18:11:19.892934Z
+36003
+blogic
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+37
+
diff --git a/package/base-files/files/etc/rc.button/.svn/prop-base/failsafe.svn-base b/package/base-files/files/etc/rc.button/.svn/prop-base/failsafe.svn-base
new file mode 100644
index 0000000..869ac71
--- /dev/null
+++ b/package/base-files/files/etc/rc.button/.svn/prop-base/failsafe.svn-base
@@ -0,0 +1,5 @@
+K 14
+svn:executable
+V 1
+*
+END
diff --git a/package/base-files/files/etc/rc.button/.svn/prop-base/reset.svn-base b/package/base-files/files/etc/rc.button/.svn/prop-base/reset.svn-base
new file mode 100644
index 0000000..869ac71
--- /dev/null
+++ b/package/base-files/files/etc/rc.button/.svn/prop-base/reset.svn-base
@@ -0,0 +1,5 @@
+K 14
+svn:executable
+V 1
+*
+END
diff --git a/package/base-files/files/etc/rc.button/.svn/prop-base/rfkill.svn-base b/package/base-files/files/etc/rc.button/.svn/prop-base/rfkill.svn-base
new file mode 100644
index 0000000..869ac71
--- /dev/null
+++ b/package/base-files/files/etc/rc.button/.svn/prop-base/rfkill.svn-base
@@ -0,0 +1,5 @@
+K 14
+svn:executable
+V 1
+*
+END
diff --git a/package/base-files/files/etc/rc.button/.svn/text-base/failsafe.svn-base b/package/base-files/files/etc/rc.button/.svn/text-base/failsafe.svn-base
new file mode 100644
index 0000000..dcdf7de
--- /dev/null
+++ b/package/base-files/files/etc/rc.button/.svn/text-base/failsafe.svn-base
@@ -0,0 +1,2 @@
+#!/bin/sh
+touch /tmp/failsafe_button
diff --git a/package/base-files/files/etc/rc.button/.svn/text-base/reset.svn-base b/package/base-files/files/etc/rc.button/.svn/text-base/reset.svn-base
new file mode 100644
index 0000000..763994d
--- /dev/null
+++ b/package/base-files/files/etc/rc.button/.svn/text-base/reset.svn-base
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+[ "${ACTION}" = "released" ] || exit 0
+
+. /lib/functions.sh
+
+logger "$BUTTON pressed for $SEEN seconds"
+
+if [ "$SEEN" -lt 1 ]
+then
+ echo "REBOOT" > /dev/console
+ sync
+ reboot
+elif [ "$SEEN" -gt 5 ]
+then
+ echo "FACTORY RESET" > /dev/console
+ firstboot && reboot &
+fi
diff --git a/package/base-files/files/etc/rc.button/.svn/text-base/rfkill.svn-base b/package/base-files/files/etc/rc.button/.svn/text-base/rfkill.svn-base
new file mode 100644
index 0000000..7a8cfe9
--- /dev/null
+++ b/package/base-files/files/etc/rc.button/.svn/text-base/rfkill.svn-base
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+[ "${ACTION}" = "released" ] || exit 0
+
+. /lib/functions.sh
+
+local rfkill_state=0
+
+wifi_rfkill_set() {
+ uci set wireless.$1.disabled=$rfkill_state
+}
+
+wifi_rfkill_check() {
+ local disabled
+ config_get disabled $1 disabled
+ [ "$disabled" = "1" ] || rfkill_state=1
+}
+
+config_load wireless
+config_foreach wifi_rfkill_check wifi-device
+config_foreach wifi_rfkill_set wifi-device
+uci commit wireless
+wifi up
diff --git a/package/base-files/files/etc/rc.button/failsafe b/package/base-files/files/etc/rc.button/failsafe
new file mode 100755
index 0000000..dcdf7de
--- /dev/null
+++ b/package/base-files/files/etc/rc.button/failsafe
@@ -0,0 +1,2 @@
+#!/bin/sh
+touch /tmp/failsafe_button
diff --git a/package/base-files/files/etc/rc.button/reset b/package/base-files/files/etc/rc.button/reset
new file mode 100755
index 0000000..763994d
--- /dev/null
+++ b/package/base-files/files/etc/rc.button/reset
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+[ "${ACTION}" = "released" ] || exit 0
+
+. /lib/functions.sh
+
+logger "$BUTTON pressed for $SEEN seconds"
+
+if [ "$SEEN" -lt 1 ]
+then
+ echo "REBOOT" > /dev/console
+ sync
+ reboot
+elif [ "$SEEN" -gt 5 ]
+then
+ echo "FACTORY RESET" > /dev/console
+ firstboot && reboot &
+fi
diff --git a/package/base-files/files/etc/rc.button/rfkill b/package/base-files/files/etc/rc.button/rfkill
new file mode 100755
index 0000000..7a8cfe9
--- /dev/null
+++ b/package/base-files/files/etc/rc.button/rfkill
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+[ "${ACTION}" = "released" ] || exit 0
+
+. /lib/functions.sh
+
+local rfkill_state=0
+
+wifi_rfkill_set() {
+ uci set wireless.$1.disabled=$rfkill_state
+}
+
+wifi_rfkill_check() {
+ local disabled
+ config_get disabled $1 disabled
+ [ "$disabled" = "1" ] || rfkill_state=1
+}
+
+config_load wireless
+config_foreach wifi_rfkill_check wifi-device
+config_foreach wifi_rfkill_set wifi-device
+uci commit wireless
+wifi up