]> git.pld-linux.org Git - packages/dhcpv6.git/blame - dhcp6c.init
- rel 1
[packages/dhcpv6.git] / dhcp6c.init
CommitLineData
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
982871cc 13
05357254 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/dhcp6c ] && . /etc/sysconfig/dhcp6c
22
23# Check that networking is up.
24if is_yes "${NETWORKING}"; then
e39b0a43 25 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
982871cc 26 msg_network_down "DHCPv6 client daemon"
e39b0a43
ER
27 exit 1
28 fi
29else
30 exit 0
05357254 31fi
32
833a3882 33start() {
e39b0a43
ER
34 # Check if the service is already running?
35 if [ ! -f /var/lock/subsys/dhcp6c ]; then
982871cc 36 msg_starting "DHCPv6 client daemon"
e39b0a43
ER
37 daemon dhcp6c $DHCP6CIF
38 RETVAL=$?
39 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/dhcp6c
40 else
982871cc 41 msg_already_running "DHCPv6 client daemon"
e39b0a43 42 fi
833a3882
ER
43}
44
45stop() {
e39b0a43 46 if [ -f /var/lock/subsys/dhcp6c ]; then
982871cc 47 msg_stopping "DHCPv6 client daemon"
e39b0a43
ER
48 killproc dhcp6c
49 rm -f /var/run/dhcp6c.pid /var/lock/subsys/dhcp6c >/dev/null 2>&1
50 else
982871cc 51 msg_not_running "DHCPv6 client daemon"
e39b0a43 52 fi
833a3882
ER
53}
54
55RETVAL=0
56case "$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 ;;
05357254 67 status)
e39b0a43
ER
68 status dhcp6c
69 exit $?
70 ;;
05357254 71 *)
e39b0a43
ER
72 msg_usage "$0 {start|stop|restart|force-reload|status}"
73 exit 3
05357254 74esac
2cba2f07 75
05357254 76exit $RETVAL
This page took 0.088196 seconds and 4 git commands to generate.