[OpenWrt-Devel] [PATCH RFC] base-files: switch reset button support to hotplug.d
Rafał Miłecki
zajec5 at gmail.com
Sat May 9 16:33:52 EDT 2015
For years now we have procd (with its hotplug support) and action JSON
executing all scripts in /etc/hotplug.d/SUBSYSTEM/. Move reset button
support to handle it the same way we handle other subsystems.
Signed-off-by: Rafał Miłecki <zajec5 at gmail.com>
---
package/base-files/files/etc/hotplug.d/button/reset | 18 ++++++++++++++++++
package/base-files/files/etc/rc.button/reset | 18 ------------------
2 files changed, 18 insertions(+), 18 deletions(-)
create mode 100755 package/base-files/files/etc/hotplug.d/button/reset
delete mode 100755 package/base-files/files/etc/rc.button/reset
diff --git a/package/base-files/files/etc/hotplug.d/button/reset b/package/base-files/files/etc/hotplug.d/button/reset
new file mode 100755
index 0000000..4586f0a
--- /dev/null
+++ b/package/base-files/files/etc/hotplug.d/button/reset
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+[ "$BUTTON" = "reset" -a "${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
+ jffs2reset -y && reboot &
+fi
diff --git a/package/base-files/files/etc/rc.button/reset b/package/base-files/files/etc/rc.button/reset
deleted file mode 100755
index 229b503..0000000
--- a/package/base-files/files/etc/rc.button/reset
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/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
- jffs2reset -y && reboot &
-fi
--
1.8.4.5
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
More information about the openwrt-devel
mailing list