#!/bin/sh # # chkconfig: 345 95 40 # # description: SNMP daemon for the FastTrak product line # # processname: ftsnmpd # Source function library. ### BEGIN INIT INFO # Provides: # Required-Start: snmp # Required-Stop: # Default-Start: 3 4 5 # Default-Stop: 0 1 2 6 # Description: SNMP daemon for the FastTrak product line ### END INIT INFO FTSNMPD=/usr/sbin/ftsnmpd killproc_rh () { local proc=$1 local sig=$2 killproc $proc $sig } killproc_suse () { local proc=$1 local sig=$2 killproc $sig $proc } if [ -f /etc/rc.d/init.d/functions ]; then # RedHat . /etc/rc.d/init.d/functions START=daemon STOP=killproc_rh STATUS=status $FTSNMPD elif [ -f /etc/rc.config ]; then # SusE . /etc/rc.config [ "x$START_FTSNMPD" = "xyes" ] || exit 0 . /etc/rc.status START=startproc STOP=killproc_suse STATUS="rc_status -v" else echo "Cannot determine distribution" >&2 exit 1 fi # See how we were called. case "$1" in start) echo -n "Starting ftsnmpd: " $START $FTSNMPD $STATUS ;; stop) echo -n "Stopping ftsnmpd: " $STOP $FTSNMPD "-15" $STATUS ;; status) $STATUS ;; restart|reload) $0 stop $0 start ;; *) exit 1 esac