File: S99upsmon

package info (click to toggle)
nut 2.2.2-6.5
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 6,240 kB
  • ctags: 4,918
  • sloc: ansic: 42,528; sh: 10,284; makefile: 860
file content (37 lines) | stat: -rwxr-xr-x 713 bytes parent folder | download | duplicates (11)
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
#! /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

# 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