Lines 3-9
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 |
DHCPD_CONF=${DHCPD_CONF:-/etc/dhcp/dhcpd.conf} |
6 |
DHCPD_CONF=${DHCPD_CONF:-/etc/dhcp/${SVCNAME}.conf} |
|
|
7 |
if [ "$(sed 's/[^6]*//' <<< "${SVCNAME}")" == "6" ] ; then |
8 |
DHCPD_OPTS="${DHCPD_OPTS} -6" |
9 |
einfo "y" |
10 |
else |
11 |
DHCPD_OPTS="${DHCPD_OPTS} -4" |
12 |
einfo "n" |
13 |
fi |
7 |
|
14 |
|
8 |
depend() { |
15 |
depend() { |
9 |
need net |
16 |
need net |
Lines 33-39
Link Here
|
33 |
fi |
40 |
fi |
34 |
|
41 |
|
35 |
local leasefile="$(get_var lease-file-name)" |
42 |
local leasefile="$(get_var lease-file-name)" |
36 |
leasefile="${DHCPD_CHROOT}/${leasefile:-/var/lib/dhcp/dhcpd.leases}" |
43 |
leasefile="${DHCPD_CHROOT}/${leasefile:-/var/lib/dhcp/${SVCNAME}.leases}" |
37 |
if [ ! -f "${leasefile}" ] ; then |
44 |
if [ ! -f "${leasefile}" ] ; then |
38 |
ebegin "Creating ${leasefile}" |
45 |
ebegin "Creating ${leasefile}" |
39 |
touch "${leasefile}" |
46 |
touch "${leasefile}" |
Lines 48-60
Link Here
|
48 |
fi |
55 |
fi |
49 |
|
56 |
|
50 |
local pidfile="$(get_var pid-file-name)" |
57 |
local pidfile="$(get_var pid-file-name)" |
51 |
pidfile="${pidfile:-/var/run/dhcp/dhcpd.pid}" |
58 |
pidfile="${pidfile:-/var/run/dhcp/${SVCNAME}.pid}" |
52 |
|
59 |
|
53 |
ebegin "Starting ${DHCPD_CHROOT:+chrooted }${SVCNAME}" |
60 |
ebegin "Starting ${DHCPD_CHROOT:+chrooted }${SVCNAME}" |
54 |
start-stop-daemon --start --exec /usr/sbin/dhcpd \ |
61 |
start-stop-daemon --start --exec /usr/sbin/dhcpd \ |
55 |
--pidfile "${DHCPD_CHROOT}/${pidfile}" \ |
62 |
--pidfile "${DHCPD_CHROOT}/${pidfile}" \ |
56 |
-- ${DHCPD_OPTS} -q -pf "${pidfile}" \ |
63 |
-- ${DHCPD_OPTS} -q -pf "${pidfile}" \ |
57 |
-user dhcp -group dhcp \ |
64 |
-user dhcp -group dhcp -lf "${leasefile}" \ |
58 |
${DHCPD_CHROOT:+-chroot} ${DHCPD_CHROOT} ${DHCPD_IFACE} |
65 |
${DHCPD_CHROOT:+-chroot} ${DHCPD_CHROOT} ${DHCPD_IFACE} |
59 |
eend $? \ |
66 |
eend $? \ |
60 |
&& save_options chroot "${DHCPD_CHROOT}" \ |
67 |
&& save_options chroot "${DHCPD_CHROOT}" \ |