Thu Feb 13 2003 Than Ngo <than@redhat.com> 1.2.0-6 - build with correct userid #84199 - fix directory permission Tue Feb 11 2003 Than Ngo <than@redhat.com> 1.2.0-5 - add user nut, bug #81500 - fix permission issue, bug #81524, #83997 - own /etc/ups, bug #73959 Wed Jan 22 2003 Tim Powers <timp@redhat.com> - rebuilt Wed Jan 08 2003 Thomas Woerner <twoerner@redhat.com> 1.2.0-3 - added html templates for cgi scripts (#78532) - added hidups driver (#80334) Wed Dec 18 2002 Dan Walsh <dwalsh@redhat.com> 1.2.0-2 - Fix service description Wed Nov 06 2002 han Ngo <than@redhat.com> 1.2.0-1 - update to 1.2.0 Mon Nov 04 2002 Than Ngo <than@redhat.com> 1.00-1 - update to 1.00
106 lines
1.7 KiB
Bash
106 lines
1.7 KiB
Bash
#!/bin/bash
|
|
#
|
|
# chkconfig: - 26 74
|
|
# description: Network UPS Tools is a collection of programs which provide a common \
|
|
# interface for monitoring and administering UPS hardware.
|
|
|
|
# processname: upsd
|
|
# config: /etc/ups/
|
|
|
|
# Source function library.
|
|
if [ -f /etc/init.d/functions ]; then
|
|
. /etc/init.d/functions
|
|
elif [ -f /etc/rc.d/init.d/functions ]; then
|
|
. /etc/rc.d/init.d/functions
|
|
else
|
|
exit 0
|
|
fi
|
|
|
|
# Get config.
|
|
if [ -f /etc/sysconfig/ups ]; then
|
|
. /etc/sysconfig/ups
|
|
else
|
|
SERVER="no"
|
|
fi
|
|
|
|
start() {
|
|
if [ "$SERVER" = "yes" ]; then
|
|
# Exit if server = yes and model = NONE (not configured)
|
|
|
|
if [ "$MODEL" = "NONE" ]; then
|
|
exit 0
|
|
fi
|
|
|
|
echo -n $"Starting $MODEL: "
|
|
daemon /sbin/$MODEL $OPTIONS $DEVICE
|
|
echo
|
|
|
|
prog="upsd"
|
|
echo -n $"Starting $prog: "
|
|
daemon /usr/sbin/upsd
|
|
RETVAL=$?
|
|
echo
|
|
|
|
echo -n $"Starting UPS monitor (master): "
|
|
daemon /usr/sbin/upsmon
|
|
echo
|
|
else
|
|
echo -n $"Starting UPS monitor (slave): "
|
|
daemon /usr/sbin/upsmon
|
|
echo
|
|
fi
|
|
|
|
[ "$RETVAL" = 0 ] && touch /var/lock/subsys/ups
|
|
}
|
|
|
|
stop() {
|
|
echo -n $"Stopping UPS monitor: "
|
|
killproc upsmon
|
|
echo
|
|
|
|
if [ "$SERVER" = "yes" ]; then
|
|
prog="upsd"
|
|
echo -n $"Stopping $prog: "
|
|
killproc upsd
|
|
RETVAL=$?
|
|
echo
|
|
|
|
echo -n $"Shutting down $MODEL: "
|
|
killproc $MODEL
|
|
echo
|
|
fi
|
|
[ "$RETVAL" = 0 ] && rm -f /var/lock/subsys/ups
|
|
}
|
|
|
|
restart() {
|
|
stop
|
|
start
|
|
}
|
|
|
|
# See how we are called.
|
|
case "$1" in
|
|
start)
|
|
start
|
|
;;
|
|
stop)
|
|
stop
|
|
;;
|
|
restart)
|
|
restart
|
|
;;
|
|
condrestart)
|
|
[ -f /var/lock/subsys/ups ] && restart || :
|
|
;;
|
|
status)
|
|
if [ "$HOST" = "localhost" ]; then
|
|
status upsd
|
|
status $MODEL
|
|
fi
|
|
status upsmon
|
|
;;
|
|
*)
|
|
echo $"Usage: $0 {start|stop|restart|condrestart|status}"
|
|
exit 1
|
|
esac
|
|
|
|
exit $RETVAL
|