#!/bin/sh # # ipband This shell script takes care of starting and stopping ipband. # # chkconfig: - 85 15 # description: IP Bandwidth Watchdog # processname: ipband # config: /etc/ipband.conf # pidfile: /var/run/ipband.pid NAME=ipband [ -f /etc/$NAME.conf ] || exit 0 # Do not load RH compatibility interface. WITHOUT_RC_COMPAT=1 # Source function library. . /etc/init.d/functions PIDFILE=/var/run/$NAME.pid LOCKFILE=/var/lock/subsys/$NAME RETVAL=0 SERVICE_ARGS="--pidfile $PIDFILE --lockfile $LOCKFILE --expect-user root" start() { start_daemon $SERVICE_ARGS --make-pidfile "$PIDFILE" -- $NAME RETVAL=$? return $RETVAL } stop() { stop_daemon $SERVICE_ARGS -- $NAME RETVAL=$? return $RETVAL } restart() { stop start } mystatus() { status $SERVICE_ARGS -- $NAME RETVAL=$? return $RETVAL } function ipband_main() { case "$1" in start) start ;; stop) stop ;; reload) restart ;; restart) restart ;; status) mystatus ;; condstop) [ -e "$LOCKFILE" ] && stop ;; condrestart) [ -e "$LOCKFILE" ] && restart ;; condreload) [ -e "$LOCKFILE" ] && restart ;; *) msg_usage "${0##*/} {start|stop|reload|restart|condstop|condrestart|condreload|status}" RETVAL=1 esac return $RETVAL } ipband_main "$@" ## EOF ##