diff options
Diffstat (limited to 'src/etc/dhcp/dhclient-enter-hooks.d/02-vyos-stopdhclient')
-rw-r--r-- | src/etc/dhcp/dhclient-enter-hooks.d/02-vyos-stopdhclient | 2 |
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 |