[v2] Disable VPN if not in use

Christian Dresel fff at chrisi01.de
Di Feb 13 13:27:37 CET 2018


The simplest and fasted way to
Fixes #72

Signed-off-by: Christian Dresel <fff at chrisi01.de>
Reviewed-by: Robert Langhammer <rlanghammer at web.de>

---

Update in v2:
  * rename disable-vpn to vpn-stop

Signed-off-by: Christian Dresel <fff at chrisi01.de>
---
 src/packages/fff/fff-hoods/files/usr/sbin/configurehood | 2 ++
 src/packages/fff/fff-vpn-select/files/usr/sbin/vpn-stop | 7 +++++++
 2 files changed, 9 insertions(+)
 create mode 100755 src/packages/fff/fff-vpn-select/files/usr/sbin/vpn-stop

diff --git a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
index cf79b42..05082a6 100755
--- a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
+++ b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
@@ -279,6 +279,8 @@ if [ -s "$hoodfile" ]; then
 	
 	if hasInternet ; then
 		sh /usr/sbin/vpn-select
+	else
+		sh /usr/sbin/vpn-stop
 	fi
 
 	# now we load the prefix from the hoodfile and set this to br-mesh
diff --git a/src/packages/fff/fff-vpn-select/files/usr/sbin/vpn-stop b/src/packages/fff/fff-vpn-select/files/usr/sbin/vpn-stop
new file mode 100755
index 0000000..9d7fd9a
--- /dev/null
+++ b/src/packages/fff/fff-vpn-select/files/usr/sbin/vpn-stop
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+>/etc/config/tunneldigger
+rm /tmp/fastd_fff_peers/*
+/etc/init.d/fastd stop
+/etc/init.d/tunneldigger stop
+
-- 
2.11.0



Mehr Informationen über die Mailingliste franken-dev