aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files
diff options
context:
space:
mode:
authorAlan Swanson <reiver@improbability.net>2019-05-29 11:28:33 +0100
committerPetr Štetiar <ynezz@true.cz>2019-05-30 11:55:49 +0200
commit70c7a0c33e3789fcc13b868bd41ffbd59ea999f1 (patch)
treecaa31d40b54b2188ce8772d532fee60b01e50c35 /package/base-files
parent6a92eb5b382860017fd00cd05350a648c4a4ac56 (diff)
downloadupstream-70c7a0c33e3789fcc13b868bd41ffbd59ea999f1.tar.gz
upstream-70c7a0c33e3789fcc13b868bd41ffbd59ea999f1.tar.bz2
upstream-70c7a0c33e3789fcc13b868bd41ffbd59ea999f1.zip
base-files: add reboot only button handler
For devices such as BTHOMEHUBV5A with both reset and restart buttons, its easily accessible restart button has been assigned to KEY_POWER power script to poweroff preventing accidental (or malicious) factory resets by KEY_RESTART reset script. However an easily accessible button immediately powering off the device is also undesirable. Fixes: FS#1965 Signed-off-by: Alan Swanson <reiver@improbability.net> Signed-off-by: Petr Štetiar <ynezz@true.cz> [long line wrap]
Diffstat (limited to 'package/base-files')
-rwxr-xr-xpackage/base-files/files/etc/rc.button/reboot12
1 files changed, 12 insertions, 0 deletions
diff --git a/package/base-files/files/etc/rc.button/reboot b/package/base-files/files/etc/rc.button/reboot
new file mode 100755
index 0000000000..cd547e3329
--- /dev/null
+++ b/package/base-files/files/etc/rc.button/reboot
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+[ "${ACTION}" = "released" ] || exit 0
+
+if [ "$SEEN" -ge 5 ]
+then
+ echo "REBOOT" > /dev/console
+ sync
+ reboot
+fi
+
+return 0