summaryrefslogtreecommitdiffstats
path: root/package/base-files/files/etc/rc.button/reset
diff options
context:
space:
mode:
Diffstat (limited to 'package/base-files/files/etc/rc.button/reset')
-rwxr-xr-xpackage/base-files/files/etc/rc.button/reset18
1 files changed, 18 insertions, 0 deletions
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 000000000..763994d07
--- /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