aboutsummaryrefslogtreecommitdiff
path: root/network/yadifa/rc.yadifa
blob: 63a35376edbdece6a9a866268a12a698c4b96117 (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
52
53
#!/bin/sh
#
# Start/stop/restart yadifad
#

do_start() {
  if [ -x /usr/sbin/yadifad ]; then
    echo -n "Starting YADIFA DNS Server:  /usr/sbin/yadifad -c /etc/yadifa/yadifad.conf --daemon... "
    /usr/sbin/yadifad -c /etc/yadifa/yadifad.conf --daemon 2> /dev/null
    echo "done."
  fi
}

do_stop() {
  echo -n "Stopping YADIFA DNS Server: "
  kill $(cat /var/run/yadifa/yadifad.pid) 2> /dev/null
  sleep 2
  echo "done."
}

do_restart() {
  do_stop
  sleep 1
  do_start
}

do_reload() {
  /usr/bin/yadifa cfgreload
}

do_logreopen() {
  /usr/bin/yadifa logreopen
}

case "$1" in
'start')
 do_start
  ;;
'stop')
  do_stop
  ;;
'restart')
 do_restart
  ;;
'reload')
 do_reload
  ;;
'logreopen')
  do_logreopen
  ;;
*)
  echo "usage $0 start|stop|restart|reload|logreopen"
esac