updated on Wed Jan 25 08:34:36 UTC 2012
[aur-mirror.git] / ndisc6 / rdnssd.rc.d
blob3c0a6a53ce1c28cf2b54a3c63bbb10de7163ff97
1 #!/bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
5 . /etc/conf.d/rdnssd
7 PIDFILE="/var/run/rdnssd.pid"
8 PID=`cat "$PIDFILE" 2>/dev/null`
9 case "$1" in
10 start)
11 stat_busy "Starting RDNSS Daemon"
12 if [ ! -z "$PID" -a -e "/proc/$PID" ]; then
13 stat_append "-- Already running"
14 stat_die
15 else
16 /usr/sbin/rdnssd -p "$PIDFILE" \
17 ${MERGEHOOK/*/-H} "$MERGEHOOK" \
18 ${RUN_AS/*/-u} "$RUN_AS"
20 if [ $? -gt 0 ]; then
21 stat_fail
22 else
23 add_daemon rdnssd
24 stat_done
28 stop)
29 stat_busy "Stopping RDNSS Daemon"
30 if [ -z "$PID" ]; then
31 stat_append "-- Not running"
32 stat_die
33 else
34 kill $PID &> /dev/null
35 if [ $? -gt 0 ]; then
36 stat_fail
37 else
38 rm_daemon sshd
39 stat_done
43 restart)
44 $0 stop
45 sleep 1
46 $0 start
49 echo "usage: $0 {start|stop|restart}"
50 esac
51 exit 0