aboutsummaryrefslogtreecommitdiff
path: root/utils/acpid/files
diff options
context:
space:
mode:
Diffstat (limited to 'utils/acpid/files')
-rw-r--r--utils/acpid/files/acpid.hotplug7
-rw-r--r--utils/acpid/files/acpid.init25
-rw-r--r--utils/acpid/files/default5
3 files changed, 37 insertions, 0 deletions
diff --git a/utils/acpid/files/acpid.hotplug b/utils/acpid/files/acpid.hotplug
new file mode 100644
index 000000000..6e08d01a2
--- /dev/null
+++ b/utils/acpid/files/acpid.hotplug
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+. /lib/functions.sh
+
+if [ "$ACTION" = add ] && [ "$DEVICENAME" = event0 ]; then
+ ( /etc/init.d/acpid/stop; sleep 3; /usr/sbin/acpid )&
+fi
diff --git a/utils/acpid/files/acpid.init b/utils/acpid/files/acpid.init
new file mode 100644
index 000000000..3365aa022
--- /dev/null
+++ b/utils/acpid/files/acpid.init
@@ -0,0 +1,25 @@
+#!/bin/ash /etc/rc.common
+# Copyright (C) 2009-2010 OpenWrt.org
+
+START=99
+STOP=80
+
+ACPID_BIN="/usr/sbin/acpid"
+ACPID_PID="/var/run/acpid.pid"
+
+start() {
+ [ -x "$ACPID_BIN" ] || return 1
+ start-stop-daemon -S -x $ACPID_BIN -p $ACPID_PID
+}
+
+boot() {
+ # Do nothing on boot
+ [ -x "$ACPID_BIN" ] || return 1
+ start-stop-daemon -S -x $ACPID_BIN -p $ACPID_PID
+ exit 0
+}
+
+stop() {
+ service_kill ${ACPID_BIN##*/} $ACPID_PID
+ rm -f $ACPID_PID
+}
diff --git a/utils/acpid/files/default b/utils/acpid/files/default
new file mode 100644
index 000000000..cf8d9a3f2
--- /dev/null
+++ b/utils/acpid/files/default
@@ -0,0 +1,5 @@
+# This is a sample ACPID configuration
+
+event=button/power.*
+action=/sbin/poweroff
+