1#!/bin/sh 2# 3# S95doinkd -- start or kill doinkd 4# 5 6if [ ! -f /usr/local/sbin/doinkd ]; then 7 exit 1; 8fi 9 10# Get pid to see if doinkd is active and to kill if needed. 11pid=`/usr/bin/ps -e | /usr/bin/grep doinkd | /usr/bin/sed -e 's/^ *//' -e 's/ .*//'` 12 13case "$1" in 14 'start') 15 # Start doinkd 16 if [ -f /usr/local/sbin/doinkd ]; then 17 if [ "$pid" = "" ]; then 18 /usr/local/sbin/doinkd && echo "Idle daemon started" 19 fi 20 else 21 echo "Could not find doinkd" 22 fi 23 ;; 24 25 'stop') 26 if [ "$pid" != "" ]; then 27 kill $pid 28 echo "doinkd killed" 29 fi 30 ;; 31 32 'restart') 33 start() 34 stop() 35 ;; 36 *) 37 echo "usage: S95doinkd {start|stop|restart}" 38 ;; 39esac 40