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:
Florian Eckert
2017-07-31 11:46:21 +02:00
parent 487278dcd1
commit 0b44ca505b
4 changed files with 10 additions and 7 deletions
+1 -1
View File
@@ -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