1 1.1 thorpej #!/bin/sh - 2 1.1 thorpej # 3 1.1 thorpej # $NetBSD: power_button,v 1.1 2003/04/18 05:40:06 thorpej Exp $ 4 1.1 thorpej # 5 1.1 thorpej # Generic script for power button events. We simply attempt to 6 1.1 thorpej # shut the system down gracefully, and let the kernel handle 7 1.1 thorpej # the poweroff. 8 1.1 thorpej # 9 1.1 thorpej # Arguments passed by powerd(8): 10 1.1 thorpej # 11 1.1 thorpej # device event 12 1.1 thorpej 13 1.1 thorpej case "${2}" in 14 1.1 thorpej pressed) 15 1.1 thorpej /sbin/shutdown -p now 16 1.1 thorpej exit 0 17 1.1 thorpej ;; 18 1.1 thorpej 19 1.1 thorpej *) 20 1.1 thorpej echo "${0}: unsupported event ${2} on device ${1}" >&1 21 1.1 thorpej exit 1 22 1.1 thorpej ;; 23 1.1 thorpej esac 24