]>
Commit | Line | Data |
---|---|---|
eaf7319c | 1 | #!/bin/sh |
2 | # | |
3 | # dhcp6s dhcp6s is an implementation of DHCPv6 server. | |
4 | # This shell script takes care of starting and stopping | |
5 | # dhcp6s. | |
6 | # | |
7 | # chkconfig: - 66 36 | |
8 | # description: dhcp6s supports server side of Dynamic Host Configuration | |
9 | # Protocol for IPv6. | |
10 | # processname: dhcp6s | |
11 | # config: /etc/dhcp6s.conf | |
12 | # config: /etc/server6_addr.conf | |
13 | # config: /etc/sysconfig/dhcp6s | |
14 | # Source function library | |
15 | . /etc/rc.d/init.d/functions | |
16 | ||
17 | # Get network config | |
18 | . /etc/sysconfig/network | |
19 | ||
20 | # Get service config | |
21 | [ -f /etc/sysconfig/dhcp6s ] && . /etc/sysconfig/dhcp6s | |
22 | ||
23 | # Check that networking is up. | |
24 | if is_yes "${NETWORKING}"; then | |
e39b0a43 ER |
25 | if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then |
26 | msg_network_down DHCP6S | |
27 | exit 1 | |
28 | fi | |
29 | else | |
30 | exit 0 | |
eaf7319c | 31 | fi |
32 | ||
833a3882 | 33 | start() { |
e39b0a43 ER |
34 | # Check if the service is already running? |
35 | if [ ! -f /var/lock/subsys/dhcp6s ]; then | |
36 | msg_starting "DHCP6S" | |
37 | daemon dhcp6s $DHCP6SIF | |
38 | RETVAL=$? | |
39 | [ $RETVAL -eq 0 ] && touch /var/lock/subsys/dhcp6s | |
40 | else | |
41 | msg_already_running DHCP6S | |
42 | fi | |
833a3882 ER |
43 | } |
44 | ||
45 | stop() { | |
e39b0a43 ER |
46 | if [ -f /var/lock/subsys/dhcp6s ]; then |
47 | msg_stopping "DHCP6S Server" | |
48 | killproc dhcp6s | |
49 | rm -f /var/run/dhcp6s.pid /var/lock/subsys/dhcp6s >/dev/null 2>&1 | |
50 | else | |
51 | msg_not_running DHCP6S | |
52 | fi | |
833a3882 ER |
53 | } |
54 | ||
55 | RETVAL=0 | |
56 | case "$1" in | |
57 | start) | |
58 | start | |
59 | ;; | |
60 | stop) | |
61 | stop | |
e39b0a43 ER |
62 | ;; |
63 | restart|reload) | |
833a3882 ER |
64 | stop |
65 | start | |
e39b0a43 | 66 | ;; |
eaf7319c | 67 | status) |
e39b0a43 ER |
68 | status dhcp6s |
69 | exit $? | |
70 | ;; | |
eaf7319c | 71 | *) |
e39b0a43 ER |
72 | msg_usage "$0 {start|stop|restart|force-reload|status}" |
73 | exit 3 | |
eaf7319c | 74 | esac |
2cba2f07 | 75 | |
eaf7319c | 76 | exit $RETVAL |