From cde2a77ed3b3b0df9e693e121dccdc97ef163156 Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Fri, 17 Jul 2020 10:35:11 +0200 Subject: [PATCH] mwan3: also cleanup lock on mwan3 stop Signed-off-by: Florian Eckert --- net/mwan3/files/lib/mwan3/mwan3.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/net/mwan3/files/lib/mwan3/mwan3.sh b/net/mwan3/files/lib/mwan3/mwan3.sh index 652cbfd42..105aafa0c 100644 --- a/net/mwan3/files/lib/mwan3/mwan3.sh +++ b/net/mwan3/files/lib/mwan3/mwan3.sh @@ -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 }