mirror of
https://github.com/openwrt/packages.git
synced 2026-01-10 11:44:48 +00:00
net/mwan3: fix mwan3track kill execution
If two interface have the same prefix "wan" for example "wan" and "wan1" pgrep returns the PID for wan1 also "pgrep -f mwan3track wan". Before this fix "wan1" was also killed! This is not what we want. Signed-off-by: Florian Eckert <fe@dev.tdt.de>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
. /lib/functions/network.sh
|
||||
. /usr/share/libubox/jshn.sh
|
||||
|
||||
MWAN3_STATUS_DIR="/var/run/mwan3track"
|
||||
@@ -34,10 +35,12 @@ get_mwan3_status() {
|
||||
local iface="${1}"
|
||||
local iface_select="${2}"
|
||||
local running="0"
|
||||
local pid
|
||||
local pid device
|
||||
|
||||
network_get_device device $1
|
||||
|
||||
if [ "${iface}" = "${iface_select}" ] || [ "${iface_select}" = "" ]; then
|
||||
pid="$(pgrep -f "mwan3track $iface")"
|
||||
pid="$(pgrep -f "mwan3track $iface $device")"
|
||||
if [ "${pid}" != "" ]; then
|
||||
running="1"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user