#!/bin/sh # # bopm BOPM daemon. # # chkconfig: 345 80 20 # # description: The Blitzed Open Proxy Monitor # # $Id$ # Source function library . /etc/rc.d/init.d/functions # Get network config . /etc/sysconfig/network # Get service config [ -f /etc/sysconfig/bopm ] && . /etc/sysconfig/bopm # Check that networking is up. if is_yes "${NETWORKING}"; then if [ ! -f /var/lock/subsys/network ]; then msg_network_down bopm exit 1 fi else exit 0 fi # See how we were called. case "$1" in start) # Check if the service is already running? if [ ! -f /var/lock/subsys/bopm ]; then msg_starting bopm daemon --user bopm bopm RETVAL=$? [ $RETVAL -eq 0 ] && touch /var/lock/subsys/bopm else msg_already_running bopm fi ;; stop) if [ -f /var/lock/subsys/bopm ]; then # Stop daemons. msg_stopping bopm killproc --pidfile bopm/bopm.pid bopm rm -f /var/lock/subsys/bopm /var/run/bopm/bopm.pid else msg_not_running bopm fi ;; restart|reload|force-reload) $0 stop $0 start exit $? ;; status) status bopm RETVAL=$? ;; *) msg_usage "$0 {start|stop|restart|reload|force-reload|status}" exit 3 esac exit $RETVAL # This must be last line ! # vi:syntax=sh:tw=78:ts=4:sw=4