Create the dhcpd.leases file if it doesn't exist already, don't just

warn about it not being there.
Closes PR misc/48868
This commit is contained in:
spz 2014-07-17 07:17:03 +00:00
parent 71b444f24e
commit 652bd7d1b3
1 changed files with 11 additions and 2 deletions

View File

@ -1,6 +1,6 @@
#!/bin/sh
#
# $NetBSD: dhcpd,v 1.6 2004/08/13 18:08:03 mycroft Exp $
# $NetBSD: dhcpd,v 1.7 2014/07/17 07:17:03 spz Exp $
#
# PROVIDE: dhcpd
@ -12,8 +12,17 @@ $_rc_subr_loaded . /etc/rc.subr
name="dhcpd"
rcvar=$name
command="/usr/sbin/${name}"
start_precmd="dhcpd_precmd"
pidfile="/var/run/${name}.pid"
required_files="/etc/${name}.conf /var/db/${name}.leases"
required_files="/etc/${name}.conf"
dhcpd_precmd()
{
if [ ! -e "/var/db/${name}.leases" ]; then
echo "Creating /var/db/${name}.leases"
touch /var/db/${name}.leases
fi
}
load_rc_config $name
run_rc_command "$1"