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