#!/bin/sh # # telecamd # # chkconfig: 2345 60 60 # description: telecamd is a daemon that runs telecam (a mindstorms kit) # processname: telecamd # Source function library. . /etc/rc.d/init.d/functions [ -f /usr/sbin/telecamd ] || exit 0 RETVAL=0 # See how we were called. case "$1" in start) # Start daemons. echo -n "Starting TeleCam daemon: " daemon telecamd RETVAL=$? echo [ $RETVAL -eq 0 ] && touch /var/lock/subsys/telecamd ;; stop) # Stop daemons. echo -n "Shutting down TeleCam daemon: " killproc telecamd RETVAL=$? echo [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/telecamd ;; status) status telecamd RETVAL=$? ;; restart|reload) $0 stop $0 start RETVAL=$? ;; *) echo "Usage: telecamd {start|stop|restart|status}" exit 1 esac exit $RETVAL