Home | History | Annotate | Line # | Download | only in scripts
      1 #!/bin/sh -
      2 #
      3 #	$NetBSD: power_button,v 1.3 2003/11/01 23:04:54 mycroft Exp $
      4 #
      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.
      8 #
      9 # Arguments passed by powerd(8):
     10 #
     11 #	device event
     12 
     13 case "${2}" in
     14 pressed)
     15 	/sbin/shutdown -p now "power button pressed"
     16 	exit 0
     17 	;;
     18 
     19 *)
     20 	logger -p warning "${0}: unsupported event ${2} on device ${1}" >&1
     21 	exit 1
     22 	;;
     23 esac
     24