#!/bin/sh # # chkconfig: - 92 5 # description: dircproxy is an IRC proxy server # DIRCPROXY=/usr/bin/dircproxy # Source function library. . /etc/init.d/functions # Source networking configuration. . /etc/sysconfig/network # Check that networking is up. [ ${NETWORKING} = "no" ] && exit 0 # Default params, override in /etc/sysconfig/dircproxy RUN_AS="dircproxy" CONFIG="/etc/dircproxyrc" if [ -f /etc/sysconfig/dircproxy ]; then . /etc/sysconfig/dircproxy fi RETVAL="0" [ -x "$DIRCPROXY" ] || exit 0 # See how we were called. case "$1" in start) echo -n "Starting dircproxy: " su $RUN_AS -c ". /etc/init.d/functions && daemon $DIRCPROXY -f $CONFIG" RETVAL=$? echo [ $RETVAL -eq 0 ] && touch /var/lock/subsys/dircproxy ;; stop) echo -n "Stopping dircproxy: " killproc dircproxy RETVAL=$? echo [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/dircproxy ;; status) status dircproxy RETVAL=$? ;; restart) $0 status >/dev/null && $0 stop $0 start RETVAL=$? ;; condrestart) [ -f "/var/lock/subsys/dircproxy" ] && $0 restart || : RETVAL=$? echo ;; reload) echo -n "Reloading dircproxy: " killproc dircproxy -HUP RETVAL=$? echo ;; *) echo "Usage: $0 {start|stop|status|restart|reload}" exit 1 esac exit $RETVAL