updated on Wed Jan 11 04:01:16 UTC 2012
[aur-mirror.git] / gofish / gopherd.rc.d
blobd220c2befdfd139d89d2938dd57c7836c54be966
1 #!/bin/bash
3 ### /etc/rc.d/gopherd: Initscript for Gopher Daemon
5 . /etc/rc.conf
6 . /etc/rc.d/functions
8 PID=`pidof -o %PPID /usr/sbin/gopherd`
9 case "$1" in
10 start)
11 stat_busy "Starting Gopher Daemon"
12 [ -z "$PID" ] && \
13 /usr/sbin/gopherd -d &> /dev/null
14 if [ $? -gt 0 ]; then
15 stat_fail
16 else stat_done; add_daemon gopherd
17 echo $PID > /var/run/gopherd.pid
18 fi ;;
19 stop)
20 stat_busy "Stopping Gopher Daemon"
21 [ ! -z "$PID" ] \
22 && kill $PID &>/dev/null
23 if [ $? -gt 0 ]; then
24 stat_fail
25 else
26 stat_done; rm_daemon gopherd
27 fi ;;
28 restart)
29 $0 stop
30 sleep 1
31 $0 start ;;
33 echo "usage: $0 {start|stop|restart}"
34 esac
36 exit 0
38 ### /etc/rc.d/gopherd: Initscript for Gopher Daemon