From 70c7a0c33e3789fcc13b868bd41ffbd59ea999f1 Mon Sep 17 00:00:00 2001 From: Alan Swanson Date: Wed, 29 May 2019 11:28:33 +0100 Subject: [PATCH] base-files: add reboot only button handler MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Petr Å tetiar [long line wrap] --- package/base-files/files/etc/rc.button/reboot | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 package/base-files/files/etc/rc.button/reboot 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 000000000000..cd547e33299b --- /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 -- 2.30.2