From patchwork Tue Feb 13 12:27:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [v2] Disable VPN if not in use From: Christian Dresel X-Patchwork-Id: 787 Message-Id: <20180213122737.10783-1-fff@chrisi01.de> To: franken-dev@freifunk.net Date: Tue, 13 Feb 2018 13:27:37 +0100 The simplest and fasted way to Fixes #72 Signed-off-by: Christian Dresel Reviewed-by: Robert Langhammer --- Update in v2: * rename disable-vpn to vpn-stop Signed-off-by: Christian Dresel --- 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 +