[v2] Disable VPN if not in use

Submitted by Christian Dresel on Feb. 13, 2018, 12:27 p.m.

Details

Message ID 20180213122737.10783-1-fff@chrisi01.de
State Accepted
Headers show

Commit Message

Christian Dresel Feb. 13, 2018, 12:27 p.m.
The simplest and fasted way to
Fixes #72

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

---

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

Signed-off-by: Christian Dresel <fff@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

Patch hide | download patch | download mbox

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
+

Comments

Tim Niemeyer Feb. 13, 2018, 5:51 p.m.
Hi

Reviewed und applied

Tim

Am Dienstag, den 13.02.2018, 13:27 +0100 schrieb Christian Dresel:
> The simplest and fasted way to
> Fixes #72
> 
> Signed-off-by: Christian Dresel <fff@chrisi01.de>
> Reviewed-by: Robert Langhammer <rlanghammer@web.de>
> 
> ---
> 
> Update in v2:
>   * rename disable-vpn to vpn-stop
> 
> Signed-off-by: Christian Dresel <fff@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
>