diff options
author | John Crispin <john@openwrt.org> | 2014-06-02 12:43:00 +0000 |
---|---|---|
committer | John Crispin <john@openwrt.org> | 2014-06-02 12:43:00 +0000 |
commit | 36d0a5e3fb39eb43b64760febf668c8968bc9f38 (patch) | |
tree | 647682a0e386cef742b29e689664868dbbbf8703 /package/base-files/files/etc/rc.button | |
parent | 813a7c3827afe71f49f2985c607585900a7db4fb (diff) | |
download | upstream-36d0a5e3fb39eb43b64760febf668c8968bc9f38.tar.gz upstream-36d0a5e3fb39eb43b64760febf668c8968bc9f38.tar.bz2 upstream-36d0a5e3fb39eb43b64760febf668c8968bc9f38.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>
SVN-Revision: 40909
Diffstat (limited to 'package/base-files/files/etc/rc.button')
-rw-r--r-- | package/base-files/files/etc/rc.button/power | 5 |
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 |