#!/sbin/runscript # This script is distributed as /etc/init.d/ciped. If you have more than one # cipe interface then copy it to /etc/init.d/ciped.foo, and put the new # configuration in /etc/cipe/options.foo depend() { need net use logger } checkconfig() { # set ${OPTIONS} to the name of the options file based on the name of this init script OPTIONS="/etc/cipe/options" PIDFILE="/var/run/ciped.pid" if [ "${myservice%%.*}" = "ciped" ] && [ "${myservice##*.}" != "${myservice}" ] then OPTIONS="/etc/cipe/options.${myservice##*.}" PIDFILE="/var/run/ciped.${myservice##*.}.pid" fi if [ ! -e ${OPTIONS} ] ; then eerror "${myservice} - ${OPTIONS}" does not exist return 1 fi # the cipe ip-up script will write its pid into this filename export PIDFILE return 0 } start() { checkconfig || return 1 ebegin "Starting ${myservice}" start-stop-daemon --start --pidfile ${PIDFILE} --quiet --exec /usr/sbin/ciped-cb -- -o ${OPTIONS} eend $? } stop() { checkconfig || return 1 ebegin "Stopping ${myservice}" start-stop-daemon --stop --pidfile ${PIDFILE} --quiet --exec /usr/sbin/ciped-cb eend $? }