Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 259364
Collapse All | Expand All

(-)dhcpd.old (+23 lines)
Lines 3-8 Link Here
3
# Distributed under the terms of the GNU General Public License v2
3
# Distributed under the terms of the GNU General Public License v2
4
# $Header: /var/cvsroot/gentoo-x86/net-misc/dhcp/files/dhcpd.init,v 1.5 2007/04/02 12:34:01 uberlord Exp $
4
# $Header: /var/cvsroot/gentoo-x86/net-misc/dhcp/files/dhcpd.init,v 1.5 2007/04/02 12:34:01 uberlord Exp $
5
5
6
opts="configtest"
7
6
DHCPD_CONF=${DHCPD_CONF:-/etc/dhcp/dhcpd.conf}
8
DHCPD_CONF=${DHCPD_CONF:-/etc/dhcp/dhcpd.conf}
7
9
8
depend() {
10
depend() {
Lines 15-20 Link Here
15
		"${DHCPD_CHROOT}/${DHCPD_CONF}"
17
		"${DHCPD_CHROOT}/${DHCPD_CONF}"
16
}
18
}
17
19
20
checkconfig() {
21
	/usr/sbin/dhcpd -cf ${DHCPD_CHROOT}/${DHCPD_CONF} -t 1>/dev/null 2>&1
22
	ret=$?
23
	if [ $ret -ne 0 ]; then
24
		eerror "${SVCNAME} has detected a syntax error in your configuration files:"
25
		/usr/sbin/dhcpd -cf ${DHCPD_CHROOT}/${DHCPD_CONF} -t
26
	fi
27
28
	return $ret
29
}
30
31
configtest() {
32
	ebegin "Checking ${SVCNAME} configuration"
33
	checkconfig
34
	eend $?
35
}
36
18
start() {
37
start() {
19
	# Work out our cffile if it's on our DHCPD_OPTS
38
	# Work out our cffile if it's on our DHCPD_OPTS
20
	case " ${DHCPD_OPTS} " in
39
	case " ${DHCPD_OPTS} " in
Lines 32-37 Link Here
32
		return 1
51
		return 1
33
	fi
52
	fi
34
53
54
	checkconfig || return 1
55
35
	local leasefile="$(get_var lease-file-name)"
56
	local leasefile="$(get_var lease-file-name)"
36
	leasefile="${DHCPD_CHROOT}/${leasefile:-/var/lib/dhcp/dhcpd.leases}"
57
	leasefile="${DHCPD_CHROOT}/${leasefile:-/var/lib/dhcp/dhcpd.leases}"
37
	if [ ! -f "${leasefile}" ] ; then
58
	if [ ! -f "${leasefile}" ] ; then
Lines 63-68 Link Here
63
84
64
stop() {
85
stop() {
65
	local chroot="$(get_options chroot)"
86
	local chroot="$(get_options chroot)"
87
	
88
	checkconfig || return 1
66
89
67
	ebegin "Stopping ${chroot:+chrooted }${SVCNAME}"
90
	ebegin "Stopping ${chroot:+chrooted }${SVCNAME}"
68
	start-stop-daemon --stop --exec /usr/sbin/dhcpd \
91
	start-stop-daemon --stop --exec /usr/sbin/dhcpd \

Return to bug 259364