coova-chilli: execute firewall cleanup at shutdown
authorThibaut VARÈNE <hacks@slashdirt.org>
Thu, 27 Jan 2022 11:00:38 +0000 (12:00 +0100)
committerRosen Penev <rosenp@gmail.com>
Sun, 30 Jan 2022 05:02:28 +0000 (21:02 -0800)
Coova Chilli creates "undo" firewall scripts that are intended to be run
when the daemon is shut down. Failure to do so results in leftover
entries in firewall and duplicated ones if chilli is subsequently
restarted.

Execute these scripts when the service stops.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
net/coova-chilli/files/chilli.init

index 1c163a0d682733dc26ac8159f435c563a2e2fdbd..d5c0ce4c494fb19f3368593e9cc1a7f5298ce4f4 100644 (file)
@@ -78,6 +78,9 @@ start_service() {
 }
 
 stop_service() {
+       for undofile in /var/run/chilli.tun*.sh; do
+               sh $undofile >& /dev/null
+       done
        rm -f /var/run/chilli_*
 }