xref: /netbsd-src/etc/powerd/scripts/reset_button (revision 6f4bc2c87703ff4ee1175804219da14a23f25fa0)
1953de79cSthorpej#!/bin/sh -
2953de79cSthorpej#
3*6f4bc2c8Smycroft#	$NetBSD: reset_button,v 1.3 2003/11/01 23:04:54 mycroft Exp $
4953de79cSthorpej#
5953de79cSthorpej# Generic script for reset button events.  We simply attempt to
6953de79cSthorpej# reboot the system gracefully.
7953de79cSthorpej#
8953de79cSthorpej# Arguments passed by powerd(8):
9953de79cSthorpej#
10953de79cSthorpej#	device event
11953de79cSthorpej
12953de79cSthorpejcase "${2}" in
13953de79cSthorpejpressed)
14*6f4bc2c8Smycroft	/sbin/shutdown -r now "reset button pressed"
15953de79cSthorpej	exit 0
16953de79cSthorpej	;;
17953de79cSthorpej
18953de79cSthorpej*)
191455475aSmycroft	logger -p warning "${0}: unsupported event ${2} on device ${1}" >&1
20953de79cSthorpej	exit 1
21953de79cSthorpej	;;
22953de79cSthorpejesac
23