vpnc-script: restart dnsmasq when openconnect disconnects 19335/head
authorDavid Bentham <db260179@gmail.com>
Fri, 9 Sep 2022 08:40:02 +0000 (09:40 +0100)
committerDavid Bentham <db260179@gmail.com>
Mon, 19 Sep 2022 12:20:27 +0000 (13:20 +0100)
Signed-off-by: David Bentham <db260179@gmail.com>
net/vpnc-scripts/Makefile
net/vpnc-scripts/files/vpnc-script

index fe239c26abd114484cd52aa71c0f2e1d7ae0424c..fb4e3e2b6198a4b05151291cf39eb2e203ea0ec6 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=vpnc-scripts
 PKG_VERSION:=20151220
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 include $(INCLUDE_DIR)/package.mk
 
index 685e73d5645855100e5cadf97711935d7c9b21fd..772c4a45a1ba14b6ebae96de6a11ad551a2f8a02 100755 (executable)
@@ -164,7 +164,11 @@ do_connect() {
 }
 
 do_disconnect() {
-       rm -f "/tmp/dnsmasq.d/openconnect.$TUNDEV"
+       if [ -f "/tmp/dnsmasq.d/openconnect.$TUNDEV" ]; then
+               rm -f "/tmp/dnsmasq.d/openconnect.$TUNDEV"
+               /etc/init.d/dnsmasq restart
+       fi
+
        proto_init_update "$TUNDEV" 0
        proto_send_update "$INTERFACE"
 }