summaryrefslogtreecommitdiff
blob: 59d1fb841f5bc636a969e301d057f765e1555afa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/sbin/runscript
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-misc/udhcp/files/udhcp.rc,v 1.2 2007/02/23 12:00:10 uberlord Exp $

depend() {
	use net logger
}

checkconfig() {
	if [ ! -f /etc/udhcpd.conf ] ; then
		eerror "No /etc/udhcpd.conf file exists"
		return 1
	fi

	if [ ! -e /var/lib/misc/udhcpd.leases ] ; then
		ebegin "Creating udhcpd.leases"
		touch /var/lib/misc/udhcpd.leases || return 1
		eend $?
	fi
}

start() {
	checkconfig || return 1

	ebegin "Starting udhcpd"
	start-stop-daemon --start --exec /sbin/udhcpd \
	    --pidfile /var/run/udhcpd.pid >/dev/null
	eend $?
}

stop() {
	ebegin "Stopping udhcpd"
	start-stop-daemon --stop --exec /sbin/udhcpd \
	    --pidfile /var/run/udhcpd.pid
	eend $?
}