#!/bin/bash # # chkconfig: 345 84 02 # description: Vsys file descriptor abritrator startup. # # Sapan Bhatia # # $Id$ # $HeadURL$ # name="vsys" # Source function library. . /etc/rc.d/init.d/functions if [ -f /etc/sysconfig/$name ]; then . /etc/sysconfig/$name fi backend=${BACKEND-/vsys} conf=${CONF-/etc/$name.conf} pidfile=${PIDFILE-/var/run/$name.pid} lockfile=${LOCKFILE-/var/lock/subsys/$name} RETVAL=0 vsys=${VSYS- "/usr/bin/vsys -failsafe -backend $backend -conffile $conf -daemon"} case "$1" in start) echo -n "Starting $name:" if [ ! -d $backend ]; then mkdir $backend; fi daemon --check=vsys $vsys RETVAL=$? echo [ $RETVAL -eq 0 ] && touch ${lockfile} ;; stop) echo -n "Stopping $name:" killproc $name #killproc $name - Why were there 2 instances of this? :-| RETVAL=$? echo [ $RETVAL -eq 0 ] && rm -f ${lockfile} ${pidfile} ;; restart) $0 stop $0 start RETVAL=$? ;; *) echo $"Usage: $0 {start|stop|restart}" exit 1 ;; esac