File: S99upsmon

package info (click to toggle)
nut 2.8.3-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 24,356 kB
  • sloc: ansic: 123,904; sh: 14,718; cpp: 12,558; makefile: 5,212; python: 1,114; perl: 855; xml: 47
file content (40 lines) | stat: -rwxr-xr-x 768 bytes parent folder | download | duplicates (3)
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