Make sure we use a proper shell to run the scripts.

Add minimal functionality on OSes without /etc/rc.subr.
-- works on Solaris now.
This commit is contained in:
Hauke Fath 2005-03-03 11:02:26 +00:00 committed by Thomas Klausner
parent 13471b2fa8
commit ed1bc12dfc
2 changed files with 26 additions and 12 deletions

View file

@ -1,7 +1,7 @@
#!/bin/sh
#!@RCD_SCRIPTS_SHELL@
#
# $NetBSD: isc_dhclient.sh,v 1.2 2004/07/08 15:03:16 jeremy-c-reed Exp $
# $Id: isc_dhclient.sh,v 1.2 2004/07/08 15:03:16 jeremy-c-reed Exp $
# $NetBSD: isc_dhclient.sh,v 1.3 2005/03/03 11:02:26 hfath Exp $
# $Id: isc_dhclient.sh,v 1.3 2005/03/03 11:02:26 hfath Exp $
# PROVIDE: dhclient
# REQUIRE: network mountcritlocal
@ -11,12 +11,19 @@
# dhclient needs to start before services that syslog depends upon do.
#
. /etc/rc.subr
if [ -f /etc/rc.subr ]; then
. /etc/rc.subr
fi
name="dhclient"
rcvar="isc_dhclient"
command="@PREFIX@/sbin/${name}"
pidfile="@VARBASE@/run/${name}.pid"
load_rc_config $name
run_rc_command "$1"
if [ -f /etc/rc.subr ]; then
load_rc_config $name
run_rc_command "$1"
else
@ECHO@ -n " ${name}"
${command} ${isc_dhclient_flags}
fi

View file

@ -1,13 +1,15 @@
#!/bin/sh
#!@RCD_SCRIPTS_SHELL@
#
# $NetBSD: isc_dhcpd.sh,v 1.5 2004/07/08 15:12:25 jeremy-c-reed Exp $
# $Id: isc_dhcpd.sh,v 1.5 2004/07/08 15:12:25 jeremy-c-reed Exp $
# $NetBSD: isc_dhcpd.sh,v 1.6 2005/03/03 11:02:26 hfath Exp $
# $Id: isc_dhcpd.sh,v 1.6 2005/03/03 11:02:26 hfath Exp $
# PROVIDE: dhcpd
# REQUIRE: DAEMON
# BEFORE: LOGIN
. /etc/rc.subr
if [ -f /etc/rc.subr ]; then
. /etc/rc.subr
fi
name="dhcpd"
rcvar="isc_dhcpd"
@ -15,5 +17,10 @@ command="@PREFIX@/sbin/${name}"
pidfile="@VARBASE@/run/${name}.pid"
required_files="@PKG_SYSCONFDIR@/dhcp/${name}.conf @VARBASE@/db/dhcp/${name}.leases"
load_rc_config $name
run_rc_command "$1"
if [ -f /etc/rc.subr ]; then
load_rc_config $name
run_rc_command "$1"
else
@ECHO@ -n " ${name}"
${command} ${isc_dhcpd_flags}
fi