Patrick Welche <prlw1@cam.ac.uk>
[netbsd-mini2440.git] / etc / powerd / scripts / power_button
blob3a59d32630e9127b6a98b409c4c29895b2c5c50c
1 #!/bin/sh -
3 # $NetBSD: power_button,v 1.2 2003/10/30 17:32:45 mycroft Exp $
5 # Generic script for power button events. We simply attempt to
6 # shut the system down gracefully, and let the kernel handle
7 # the poweroff.
9 # Arguments passed by powerd(8):
11 # device event
13 case "${2}" in
14 pressed)
15 /sbin/shutdown -p now "power button pressed"
16 exit 0
20 logger -p warning "${0}: unsupported event ${2} on device ${1}" >&1
21 exit 1
23 esac