#!/bin/sh
#
# ThinkPad Configuration Tools for Linux initscript
#
# This script is part of the tpctl package
#
# Aug 2003: Written by Thomas Hood

PATH=/bin:/sbin:/usr/bin:/usr/sbin
TPCTL=/usr/bin/tpctl
unset PSL
[ -f /etc/default/tpctl ] && . /etc/default/tpctl

test -x $TPCTL || exit 0

start()
{
	[ "$PSL" ] && tpctl --quiet --psl="$PSL" > /dev/null
}

stop()
{
	[ "$PSL" ] && tpctl --quiet --psl=- > /dev/null
}

case "$1" in
start)
	echo -n "Preparing ThinkPad for use..."
	start
	echo "done."
	exit 0
	;;
stop)
	echo -n "Preparing ThinkPad for shutdown..."
	stop
	echo "done."
	exit 0
	;;
restart|force-reload)
	echo -n "Preparing ThinkPad for use..."
	stop
	start
	echo "done."
	exit 0
	;;
*)
	echo "Usage: /etc/init.d/apmiser {start|stop|restart|force-reload}" >&2
	exit 3
	;;
esac
