summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-04-14 08:04:00 +0200
committerGitHub <noreply@github.com>2021-04-14 08:04:00 +0200
commit29d0e4aff88944820aa3f635b1672f03f0e89127 (patch)
tree01eac5001b3ba572d936a1426d4d6cc27545a8ac
parentfe0ff9e748aa2f21be0804106499796ba870c28d (diff)
parent13abffe43b2a5c41bb4ec4675c227f6cf1f868da (diff)
downloadvyos-1x-29d0e4aff88944820aa3f635b1672f03f0e89127.tar.gz
vyos-1x-29d0e4aff88944820aa3f635b1672f03f0e89127.zip
Merge pull request #804 from zdc/T3471-sagitta
dhclient: T3471: Fixed dhclient processes search
-rw-r--r--src/etc/dhcp/dhclient-enter-hooks.d/02-vyos-stopdhclient2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/etc/dhcp/dhclient-enter-hooks.d/02-vyos-stopdhclient b/src/etc/dhcp/dhclient-enter-hooks.d/02-vyos-stopdhclient
index d5d90632c..939055a63 100644
--- a/src/etc/dhcp/dhclient-enter-hooks.d/02-vyos-stopdhclient
+++ b/src/etc/dhcp/dhclient-enter-hooks.d/02-vyos-stopdhclient
@@ -11,7 +11,7 @@ if [ -z ${CONTROLLED_STOP} ] ; then
ipversion_arg=`ps --no-headers --format args --pid $current_dhclient | awk '{ print $2 }'`
# get list of all dhclient running for current interface
- dhclients_pids=(`ps --no-headers --format pid,args -C dhclient | awk -v IFACE="/sbin/dhclient $ipversion_arg .*$interface$" '$0 ~ IFACE { print $1 }'`)
+ dhclients_pids=(`pgrep -f "dhclient $ipversion_arg.* $interface(\s|$)"`)
logmsg info "Current dhclient PID: $current_dhclient, Parent PID: $master_dhclient, IP version: $ipversion_arg, All dhclients for interface $interface: ${dhclients_pids[@]}"
# stop all dhclients for current interface, except current one