]> git.pld-linux.org Git - packages/dibbler.git/blob - dibbler.init
- tabs in preamble
[packages/dibbler.git] / dibbler.init
1 #!/bin/sh
2 #
3 # dibbler       DHCPv6 Server
4 #
5 # chkconfig:    345 93 11
6 #
7 # description:  dibbler is a portable DHCPv6 implementation. It supports stateful \
8 #               (i.e. IPv6 address granting) as well as stateless (i.e. option \
9 #               granting) autoconfiguration for IPv6.
10 # pidfile:      /var/run/dibbler.pid
11 # config:       /var/lib/dibbler/server.conf
12
13
14 # Source function library
15 . /etc/rc.d/init.d/functions
16
17 # Get network config
18 . /etc/sysconfig/network
19
20 #[ -f /etc/sysconfig/dibbler ] && . /etc/sysconfig/dibbler
21 # Check that networking is up.
22 if is_yes "${NETWORKING}"; then
23         if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
24                 msg_network_down dibbler
25                 exit 1
26         fi
27 else
28         exit 0
29 fi
30
31 RETVAL=0
32 # See how we were called.
33 case "$1" in
34   start)
35         # Check if the service is already running?
36         if [ ! -f /var/lock/subsys/dibbler ]; then
37                 msg_starting dibbler
38                 daemon /usr/sbin/dibbler-server start
39                 RETVAL=$?
40                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/dibbler
41         else
42                 msg_already_running dibbler
43         fi
44         ;;
45   stop)
46         # Stop daemon.
47         if [ -f /var/lock/subsys/dibbler ]; then
48                 msg_stopping dibbler
49                 killproc dibbler-server
50                 RET=$?
51                 if [ $RET -eq 0 ]; then
52                         rm -f /var/lock/subsys/dibbler /var/run/dibbler.pid >/dev/null 2>&1
53                 fi
54         else
55                 msg_not_running dibbler
56         fi
57         ;;
58   status)
59         dibbler-server status
60         ;;
61   reload|restart|force-restart)
62         $0 stop
63         $0 start
64         ;;
65   *)
66         msg_usage "$0 {start|stop|restart|reload}"
67         exit 3
68         ;;
69 esac
70
71 exit $RETVAL
This page took 0.07228 seconds and 3 git commands to generate.