1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
|
#! /bin/sh
# Copyright (c) 1995-2000 ???
#
# Author: Sandro Wefel <wefel@informatik.uni-halle.de>
#
# Put it in /etc/rc2.d/ or /etc/rc3.d depending on runlevel
#
PATH=/sbin:/bin:/usr/sbin:/usr/bin
export PATH
UPSDPATH=/usr/local/ups/sbin
NUT_QUIET_INIT_UPSNOTIFY=true
export NUT_QUIET_INIT_UPSNOTIFY
# See how we are called.
case "$1" in
'start')
if [ -x $UPSDPATH/upsmon ]; then
echo "NUT Starting UPS monitor "
$UPSDPATH/upsmon >/dev/console 2>&1
touch /var/lock/subsys/upsmon
fi
;;
'stop')
echo "NUT Stopping UPS monitor "
/usr/bin/pkill -x upsmon
rm -f /var/lock/subsys/upsmon
;;
'restart')
$0 stop
$0 start
;;
*)
echo "Usage: upsmon {start|stop|restart}"
exit 1
;;
esac
exit 0
|