aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files/files/etc
diff options
context:
space:
mode:
authorJohn Crispin <blogic@openwrt.org>2014-06-02 12:43:00 +0000
committerJohn Crispin <blogic@openwrt.org>2014-06-02 12:43:00 +0000
commite5aa6b969da09c8da4af7e830ac7cb8f6b0c0fa4 (patch)
treee5071da214cdbff0a16f1049ab3aef16f16acfd9 /package/base-files/files/etc
parent67a8c469a91b9e165b3a54703fdf2057836c8a69 (diff)
downloadmaster-187ad058-e5aa6b969da09c8da4af7e830ac7cb8f6b0c0fa4.tar.gz
master-187ad058-e5aa6b969da09c8da4af7e830ac7cb8f6b0c0fa4.tar.bz2
master-187ad058-e5aa6b969da09c8da4af7e830ac7cb8f6b0c0fa4.zip
base-files: add simple shutdown script
Since svn rev [38557] we support power buttons, for example the ACPI power button on x86 machines. Add a simple shutdown script to /etc/rc.button, to gracefully shutdown the machine after the power button is pressed. Tested on x86 and x86_64 in a kvm virtual machine. Signed-off-by: Stefan Hellermann <stefan@the2masters.de> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@40909 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/base-files/files/etc')
-rw-r--r--package/base-files/files/etc/rc.button/power5
1 files changed, 5 insertions, 0 deletions
diff --git a/package/base-files/files/etc/rc.button/power b/package/base-files/files/etc/rc.button/power
new file mode 100644
index 0000000000..0cb74b9f29
--- /dev/null
+++ b/package/base-files/files/etc/rc.button/power
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+[ "${ACTION}" = "released" ] || exit 0
+
+exec /sbin/poweroff