diff --git a/net/mwan3/files/lib/mwan3/mwan3.sh b/net/mwan3/files/lib/mwan3/mwan3.sh index 27e0d0175..f08f89914 100644 --- a/net/mwan3/files/lib/mwan3/mwan3.sh +++ b/net/mwan3/files/lib/mwan3/mwan3.sh @@ -449,7 +449,7 @@ mwan3_track() } config_list_foreach $1 track_ip mwan3_list_track_ips - kill $(pgrep -f "mwan3track $1") &> /dev/null + kill $(pgrep -f "mwan3track $1 $2") &> /dev/null if [ -n "$track_ips" ]; then [ -x /usr/sbin/mwan3track ] && /usr/sbin/mwan3track "$1" "$2" "$3" $track_ips & fi @@ -459,7 +459,7 @@ mwan3_track_signal() { local pid - pid="$(pgrep -f "mwan3track $1")" + pid="$(pgrep -f "mwan3track $1 $2")" if [ "${pid}" != "" ]; then kill -USR1 "${pid}" else @@ -789,7 +789,7 @@ mwan3_report_iface_status() config_list_foreach $1 track_ip mwan3_list_track_ips if [ -n "$track_ips" ]; then - if [ -n "$(pgrep -f "mwan3track $1")" ]; then + if [ -n "$(pgrep -f "mwan3track $1 $device")" ]; then tracking="active" else tracking="down" diff --git a/net/mwan3/files/usr/libexec/rpcd/mwan3 b/net/mwan3/files/usr/libexec/rpcd/mwan3 index f4d59220b..313ebdaf1 100755 --- a/net/mwan3/files/usr/libexec/rpcd/mwan3 +++ b/net/mwan3/files/usr/libexec/rpcd/mwan3 @@ -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 diff --git a/net/mwan3/files/usr/sbin/mwan3 b/net/mwan3/files/usr/sbin/mwan3 index f23d2e71b..043f8ec48 100755 --- a/net/mwan3/files/usr/sbin/mwan3 +++ b/net/mwan3/files/usr/sbin/mwan3 @@ -36,7 +36,7 @@ ifdown() ACTION=ifdown INTERFACE=$1 /sbin/hotplug-call iface - kill $(pgrep -f "mwan3track $1") &> /dev/null + kill $(pgrep -f "mwan3track $1 $2") &> /dev/null } ifup() diff --git a/net/mwan3/files/usr/sbin/mwan3track b/net/mwan3/files/usr/sbin/mwan3track index 718c2cb27..7e695ed77 100755 --- a/net/mwan3/files/usr/sbin/mwan3track +++ b/net/mwan3/files/usr/sbin/mwan3track @@ -10,7 +10,7 @@ IFDOWN_EVENT=0 clean_up() { $LOG notice "Stopping mwan3track for interface \"${INTERFACE}\"" - if [ "$(pgrep -f "mwan3track ${INTERFACE}")" = "" ]; then + if [ "$(pgrep -f "mwan3track ${INTERFACE} ${DEVICE}")" = "" ]; then rm -rf "/var/run/mwan3track/${INTERFACE}" &> /dev/null fi if [ -z "$(ls -A "/var/run/mwan3track")" ]; then