]> git.pld-linux.org Git - packages/dhcp.git/blame_incremental - dhcp-relay.init
- for ldap support in dhcp daemon
[packages/dhcp.git] / dhcp-relay.init
... / ...
CommitLineData
1#!/bin/sh
2# DHCP relay agent
3#
4# chkconfig: 345 80 20
5# description: DHCP relay agent
6
7# Source function library.
8. /etc/rc.d/init.d/functions
9
10# Source networking configuration.
11. /etc/sysconfig/network
12
13# Demon specified configuration.
14. /etc/sysconfig/dhcp-relay
15
16# Check that networking is up.
17if is_yes "${NETWORKING}"; then
18 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
19 msg_network_down "DHCP realay"
20 exit 1
21 fi
22else
23 exit 0
24fi
25
26if [ -n "DHCP_REALY_INTERFACES" ]; then
27 OPTIONS="-i $DHCP_REALY_INTERFACES"
28fi
29
30RETVAL=0
31# See how we were called.
32case "$1" in
33 start)
34 # Check if the service is already running?
35 if [ ! -f /var/lock/subsys/dhcp-relay ]; then
36 msg_starting "DHCP relay"
37 daemon dhcrelay $OPTIONS $DHCP_SERVERS_IP
38 RETVAL=$?
39 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/dhcp-relay
40 else
41 msg_already_running "DHCP relay"
42 fi
43 ;;
44 stop)
45 if [ -f /var/lock/subsys/dhcp-relay ]; then
46 msg_stopping "DHCP relay"
47 killproc dhcrelay
48 rm -f /var/lock/subsys/dhcp-relay
49 else
50 msg_not_running "DHCP relay"
51 fi
52 ;;
53 restart|force-reload)
54 $0 stop
55 $0 start
56 exit $?
57 ;;
58 status)
59 status dhcrelay
60 exit $?
61 ;;
62 *)
63 msg_usage "$0 {start|stop|restart|force-reload|status}"
64 exit 3
65esac
66
67exit $RETVAL
This page took 0.13882 seconds and 4 git commands to generate.