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