]> git.pld-linux.org Git - packages/dhcpv6.git/blobdiff - dhcp6c.init
- subpkg for relay daemon, server (to be summetric)
[packages/dhcpv6.git] / dhcp6c.init
index 0d024c5d1ae017fa64115b13ee8c379e9f473512..e56c0d561925c7be22c1cf856d59f0f5bf36d01d 100644 (file)
@@ -4,12 +4,14 @@
 #               This shell script takes care of starting and stopping
 #               dhcp6c.
 #
-# chkconfig: - 66 36
-# description: dhcp6c supports server side of  Dynamic Host Configuration
-#              Protocol for IPv6.
+# chkconfig: 345 66 36
+# description: dhcp6c supports server side of Dynamic Host Configuration Protocol for IPv6.
 # processname: dhcp6c
 # config: /etc/dhcp6c.conf
 # config: /etc/sysconfig/dhcp6c
+#
+# $Id$
+
 # Source function library
 . /etc/rc.d/init.d/functions
 
@@ -22,7 +24,7 @@
 # Check that networking is up.
 if is_yes "${NETWORKING}"; then
        if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
-               msg_network_down DHCP6C
+               msg_network_down "DHCPv6 client daemon"
                exit 1
        fi
 else
@@ -32,22 +34,32 @@ fi
 start() {
        # Check if the service is already running?
        if [ ! -f /var/lock/subsys/dhcp6c ]; then
-               msg_starting "DHCP6C"
+               msg_starting "DHCPv6 client daemon"
                daemon dhcp6c $DHCP6CIF
                RETVAL=$?
                [ $RETVAL -eq 0 ] && touch /var/lock/subsys/dhcp6c
        else
-               msg_already_running DHCP6C
+               msg_already_running "DHCPv6 client daemon"
        fi
 }
 
 stop() {
        if [ -f /var/lock/subsys/dhcp6c ]; then
-               msg_stopping "DHCP6C Server"
+               msg_stopping "DHCPv6 client daemon"
                killproc dhcp6c
                rm -f /var/run/dhcp6c.pid /var/lock/subsys/dhcp6c >/dev/null 2>&1
        else
-               msg_not_running DHCP6C
+               msg_not_running "DHCPv6 client daemon"
+       fi
+}
+
+condrestart() {
+       if [ -f /var/lock/subsys/dhcp6c ]; then
+               stop
+               start
+       else
+               msg_not_running "DHCPv6 client daemon"
+               RETVAL=$1
        fi
 }
 
@@ -59,16 +71,22 @@ case "$1" in
   stop)
        stop
        ;;
-  restart|reload)
+  restart)
        stop
        start
        ;;
+  try-restart)
+       condrestart 0
+       ;;
+  force-reload)
+       condrestart 7
+       ;;
   status)
        status dhcp6c
        exit $?
        ;;
   *)
-       msg_usage "$0 {start|stop|restart|force-reload|status}"
+       msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
        exit 3
 esac
 
This page took 0.098727 seconds and 4 git commands to generate.