summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorroy <roy>2016-01-20 19:28:57 +0000
committerroy <roy>2016-01-20 19:28:57 +0000
commit1c467a1369f318bd3bc1a782c79397a0e2fda0ae (patch)
treea9d39f7e6f03897f3e6a479ddddc3beaf48cd80f /net
parent8c48da275c9cb1fbb0043fba996753a8ccceba9f (diff)
downloadpkgsrc-1c467a1369f318bd3bc1a782c79397a0e2fda0ae.tar.gz
Adjust rc script to use correct pidfile.
Diffstat (limited to 'net')
-rwxr-xr-xnet/dhcpcd/files/dhcpcd.sh12
1 files changed, 11 insertions, 1 deletions
diff --git a/net/dhcpcd/files/dhcpcd.sh b/net/dhcpcd/files/dhcpcd.sh
index 1b25d8580b8..11471976e12 100755
--- a/net/dhcpcd/files/dhcpcd.sh
+++ b/net/dhcpcd/files/dhcpcd.sh
@@ -9,7 +9,17 @@ $_rc_subr_loaded . /etc/rc.subr
name="dhcpcd"
rcvar=$name
command="@PREFIX@/sbin/${name}"
-pidfile="@VARBASE@/run/${name}.pid"
load_rc_config $name
+
+# Work out what pidfile dhcpcd will use based on flags
+if [ -n "$flags" ]; then
+ myflags=$flags
+else
+ eval myflags=\$${name}_flags
+fi
+pidfile=$(eval $command -P $myflags 2>/dev/null)
+: ${pidfile:=/var/run/$name.pid}
+unset myflags
+
run_rc_command "$1"