]> git.pld-linux.org Git - packages/dhcp.git/blob - dhcp.init
- updated
[packages/dhcp.git] / dhcp.init
1 #!/bin/sh
2 # DHCP Server
3 #
4 # chkconfig:    345 80 20
5 # description:  DHCP Server
6
7 # Source function library
8 . /etc/rc.d/init.d/functions
9
10 # Get network config
11 . /etc/sysconfig/network
12
13 # Get service config
14 [ -f /etc/sysconfig/dhcpd ] && . /etc/sysconfig/dhcpd
15
16 # Check that networking is up.
17 if is_no "${NETWORKING}"; then
18         msg_network_down DHCPD
19         exit 1
20 fi
21
22 # See how we were called.
23 case "$1" in
24   start)
25         # Check if the service is already running?
26         if [ ! -f /var/lock/subsys/dhcpd ]; then
27                 msg_starting "DHCP Server"
28                 daemon dhcpd $DHCPD_INTERFACES
29                 RETVAL=$?
30                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/dhcpd
31         else
32                 msg_already_running DHCPD
33                 exit 1
34         fi
35         ;;
36   stop)
37         msg_stopping "DHCP Server"
38         killproc dhcpd
39         rm -f /var/run/dhcpd.pid
40         rm -f /var/lock/subsys/dhcpd
41         ;;
42   restart|reload)
43         $0 stop
44         $0 start
45         ;;
46   status)
47         status dhcpd
48         ;;
49   *)
50         msg_usage "$0 {start|stop|restart|reload|status}"
51         exit 1
52 esac
53
54 exit $RETVAL
This page took 0.031838 seconds and 4 git commands to generate.