2
##############################################################################
3
# Datei : /etc/init.d/smartups
4
# Beschreibung : Starten/Benden des UPS-Dienstes
6
# orig Autor : Based on /etc/init.d/lpd
7
# orig Autor : Taken in part from Miquel Smoorenburg's bcheckrc
8
##############################################################################
9
# Ge�ndert von : Peter Bieringer <pb@bieringer.de>
11
##############################################################################
12
# Ge�ndert von : Ngo Than <than@delix.de>
13
# 08.10.98 : Angepasst f�r delix
14
##############################################################################
15
# Ge�ndert von : Erik Heim <erik@seitz.de>
16
# 26.7.98 : Angepasst f�r das startup.
17
##############################################################################
24
UPSMODEL=ups-trust425+625
26
UPSMONITORHOST=some.where
28
UPSPATH=/usr/local/ups
30
##############################################################################
33
LOCKDIR=/var/lock/subsys
38
if [ "$UPSPLACE" = "local" ]; then
39
UPSMONITORHOST=localhost
42
UPSMODELSTATE=/var/state/ups/$UPSMODEL-$UPSSERIALDEV
44
##############################################################################
46
if [ -f /etc/init.d/functions ]
48
source /etc/init.d/functions
50
echo "FAIL: Datei /etc/init.d/functions ist nicht vorhanden!"
53
source_file /etc/sysconfig/runservices FAIL_ON_ERROR
54
check_service "$UPS" UPS NA_ON_ERROR
56
if [ "$UPSPLACE" = "local" ]; then
57
check_executable $UPSPATH/bin/$UPSMODEL FAIL_ON_ERROR
58
check_executable $UPSPATH/bin/upsd FAIL_ON_ERROR
60
check_executable $UPSPATH/bin/upsmon FAIL_ON_ERROR
62
check_lock $LOCKDIR/ups "$subsys_parameter"
64
##############################################################################
65
# See how we were called.
66
##############################################################################
67
case "$subsys_parameter" in
69
echo -n "Starte UPS..."
72
echo -n "Beende UPS..."
76
if [ "$UPSPLACE" = "local" ]; then
77
logexec daemon $UPSPATH/bin/$UPSMODEL /dev/$UPSSERIALDEV
78
logexec daemon $UPSPATH/bin/upsd $UPSMODELSTATE
80
logexec daemon $UPSPATH/bin/upsmon $UPSMONITORHOST
81
logexec touch $LOCKDIR/ups
87
logexec killproc upsmon
88
if [ "$UPSPLACE" = "local" ]; then
90
logexec killproc $UPSMODEL
92
logexec rm -f $LOCKDIR/ups
102
echo "Usage: ups {start|stop|restart|start_msg|stop_msg}"
108
##############################################################################