#!/bin/sh # # etad This shell script takes care of starting and stopping # etad (ETA UPS daemon). # # chkconfig: 2345 10 99 # # description: etad is the print daemon required for etad to work properly. \ # It is basically a server that monitor your UPS. # # processname: etad # config: /etc/sysconfig/etad # Source function library . /etc/rc.d/init.d/functions # Get service config [ -f /etc/sysconfig/etad ] && . /etc/sysconfig/etad RETVAL=0 # See how we were called. case "$1" in start) # Check if the service is already running? if [ ! -f /var/lock/subsys/etad ]; then msg_starting etad daemon etad $PORT RETVAL=$? [ $RETVAL -eq 0 ] && touch /var/lock/subsys/etad else msg_already_running Lpd fi ;; stop) # Stop daemons. if [ -f /var/lock/subsys/etad ]; then msg_stopping Etad killproc etad rm -f /var/lock/subsys/etad >/dev/null 2>&1 else msg_not_running etad fi ;; status) status etad exit $? ;; restart|force-reload) $0 stop $0 start exit $? ;; *) msg_usage "$0 {start|stop|restart|force-reload|status}" exit 3 esac exit $RETVAL