From 58bea85f922549b88efb8fc163ad8c82de4fdfd1 Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Wed, 21 Nov 2007 15:39:19 +0000 Subject: dhcpcd may not always be in /sbin --- net/dhcpcd.sh | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) (limited to 'net/dhcpcd.sh') diff --git a/net/dhcpcd.sh b/net/dhcpcd.sh index 322ebfff..8d6692e8 100644 --- a/net/dhcpcd.sh +++ b/net/dhcpcd.sh @@ -25,7 +25,7 @@ dhcpcd_depend() { after interface - program start /sbin/dhcpcd + program start /sbin/dhcpcd /usr/local/sbin/dhcpcd provide dhcp # We prefer dhcpcd over the others @@ -60,7 +60,7 @@ dhcpcd_start() { # Bring up DHCP for this interface ebegin "Running dhcpcd" - eval /sbin/dhcpcd "${args}" "${IFACE}" + eval dhcpcd "${args}" "${IFACE}" eend $? || return 1 _show_address @@ -68,23 +68,16 @@ dhcpcd_start() { } dhcpcd_stop() { - local pidfile="/var/run/dhcpcd-${IFACE}.pid" opts= + local pidfile="/var/run/dhcpcd-${IFACE}.pid" opts= sig=SIGTERM [ ! -f "${pidfile}" ] && return 0 - # Get our options - if [ -x /sbin/dhcpcd ] ; then - eval opts=\$dhcp_${IFVAR} - [ -z "${opts}" ] && opts=${dhcp} - fi - ebegin "Stopping dhcpcd on ${IFACE}" + eval opts=\$dhcp_${IFVAR} + [ -z "${opts}" ] && opts=${dhcp} case " ${opts} " in - *" release "*) dhcpcd -k "${IFACE}" ;; - *) - start-stop-daemon --stop --quiet \ - --exec /sbin/dhcpcd --pidfile "${pidfile}" - ;; + *" release "*) sig=SIGHUP;; esac + start-stop-daemon --stop --quiet --signal "${sig}" --pidfile "${pidfile}" eend $? } -- cgit v1.2.3