#!/bin/sh # # slideshow-initd grabs single frames for a slideshow # # chkconfig: 345 96 24 # description: grabs single frames for a slideshow # # written by jwz, 13-aug-2000 # Source function library. . /etc/rc.d/init.d/functions PATH=/home/jwz/src/slideshow:$PATH export PATH dir=/home/jwz/src/slideshow # See how we were called. case "$1" in start) cd $dir echo -n "Starting slideshow grab loop..." sleep 1 slideshow-grab-loop.sh & sleep 2 echo "done." ;; stop) echo -n "Stopping slideshow grab loop..." # "killall" hates sh scripts... #killall slideshow-grab-loop.sh slideshow-grab.sh streamer bttvgrab pids=`ps auxww | \ grep 'slideshow-grab-loop\.sh\|slideshow-grab\.sh\|streamer\|bttvgrab' | \ 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