summaryrefslogtreecommitdiff
path: root/community/ndisc6/rdnssd.rc.d
blob: 3c0a6a53ce1c28cf2b54a3c63bbb10de7163ff97 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash

. /etc/rc.conf
. /etc/rc.d/functions
. /etc/conf.d/rdnssd

PIDFILE="/var/run/rdnssd.pid"
PID=`cat "$PIDFILE" 2>/dev/null`
case "$1" in
  start)
    stat_busy "Starting RDNSS Daemon"
    if [ ! -z "$PID" -a -e "/proc/$PID" ]; then
      stat_append "-- Already running"
      stat_die
    else
      /usr/sbin/rdnssd -p "$PIDFILE"    \
        ${MERGEHOOK/*/-H}  "$MERGEHOOK" \
        ${RUN_AS/*/-u}     "$RUN_AS"

      if [ $? -gt 0 ]; then
        stat_fail
      else
        add_daemon rdnssd
        stat_done
      fi
    fi
    ;;
  stop)
    stat_busy "Stopping RDNSS Daemon"
    if [ -z "$PID" ]; then
      stat_append "-- Not running"
      stat_die
    else
      kill $PID &> /dev/null
      if [ $? -gt 0 ]; then
        stat_fail
      else
        rm_daemon sshd
        stat_done
      fi
    fi
    ;;
  restart)
    $0 stop
    sleep 1
    $0 start
    ;;
  *)
    echo "usage: $0 {start|stop|restart}"  
esac
exit 0