mwan3: also cleanup lock on mwan3 stop
authorFlorian Eckert <fe@dev.tdt.de>
Fri, 17 Jul 2020 08:35:11 +0000 (10:35 +0200)
committerFlorian Eckert <fe@dev.tdt.de>
Mon, 20 Jul 2020 06:12:31 +0000 (08:12 +0200)
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
net/mwan3/files/lib/mwan3/mwan3.sh

index 652cbfd422e41250edd29574eebbcaeb5b6cba29..105aafa0c5979391efd89228447f19ec1c17368e 100644 (file)
@@ -202,6 +202,13 @@ mwan3_unlock() {
 }
 
 mwan3_lock_clean() {
+       for pid in $(pgrep -f "lock /var/run/mwan3.lock"); do
+               kill -TERM "$pid" > /dev/null 2>&1
+       done
+       sleep 1
+       for pid in $(pgrep -f "lock /var/run/mwan3.lock"); do
+               kill -KILL "$pid" > /dev/null 2>&1
+       done
        rm -rf /var/run/mwan3.lock
 }