]>
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 | ||
33 | RETVAL=0 | |
34 | ||
35 | case "$1" in | |
e39b0a43 ER |
36 | start) |
37 | # Check if the service is already running? | |
38 | if [ ! -f /var/lock/subsys/dhcp6s ]; then | |
39 | msg_starting "DHCP6S" | |
40 | daemon dhcp6s $DHCP6SIF | |
41 | RETVAL=$? | |
42 | [ $RETVAL -eq 0 ] && touch /var/lock/subsys/dhcp6s | |
43 | else | |
44 | msg_already_running DHCP6S | |
45 | fi | |
46 | ;; | |
eaf7319c | 47 | stop) |
e39b0a43 ER |
48 | if [ -f /var/lock/subsys/dhcp6s ]; then |
49 | msg_stopping "DHCP6S Server" | |
50 | killproc dhcp6s | |
51 | rm -f /var/run/dhcp6s.pid /var/lock/subsys/dhcp6s >/dev/null 2>&1 | |
52 | else | |
53 | msg_not_running DHCP6S | |
54 | fi | |
55 | ;; | |
56 | restart|reload) | |
57 | $0 stop | |
58 | $0 start | |
59 | exit $? | |
60 | ;; | |
eaf7319c | 61 | status) |
e39b0a43 ER |
62 | status dhcp6s |
63 | exit $? | |
64 | ;; | |
eaf7319c | 65 | *) |
e39b0a43 ER |
66 | msg_usage "$0 {start|stop|restart|force-reload|status}" |
67 | exit 3 | |
eaf7319c | 68 | esac |
2cba2f07 | 69 | |
eaf7319c | 70 | exit $RETVAL |