#!/bin/sh # # slideshow-pull-initd pulls the slideshow jpeg from the internal net # # chkconfig: 345 96 24 # description: pulls the slideshow jpeg from the internal net # # written by jwz, 13-aug-2000 # Source function library. . /etc/rc.d/init.d/functions dir=/home/jwz/src/slideshow PATH=$dir:$PATH export PATH # See how we were called. case "$1" in start) cd $dir echo -n "Starting slideshow pull loop..." slideshow-pull-loop.sh & echo "done." ;; stop) echo -n "Stopping slideshow pull loop..." # "killall" hates sh scripts... #killall slideshow-pull-loop.sh pids=`ps auxww | \ grep 'slideshow-pull-loop\.sh' | \ sed 's/ */ /g' | \ cut -d' ' -f2` pids=`echo $pids` if [ "$pids" != "" ]; then echo -n " ($pids) " kill $pids else echo -n " (nothing to kill) " fi echo "done." ;; restart) $0 stop $0 start ;; *) echo "Usage: $0 {start|stop|restart}" exit 1 esac