#!/bin/sh -
# $Id: lid_switch,v 1.2 2005/09/03 23:21:26 abs Exp $
#
# Sample /etc/powerd/scripts/lid_switch for NetBSD with powered=YES in rc.conf
#
# Currently (as of NetBSD 2.x or 3.x) NetBSD/i386 with and ACPI enabled kernel
# does not fully suspend or hibernate on closing the lid. This script at least
# allows all network interfaces to be shutdown and restarted when the lid is
# opened. This can be useful for moving the laption between rooms in the same
# building or very short journeys (providing it has sufficient ventilation)
#
# Arguments passed by powerd(8):
#	device event

case "${2}" in
    pressed)	/etc/rc.d/autonet stop	;;
    released)	/etc/rc.d/autonet start	;;
    *)
	logger -p warning "${0}: unsupported event ${2} on device ${1}" >&1
	exit 1
	;;
esac
exit 0
