From 1a912bf6451cd8cd8045db60297356020220aea3 Mon Sep 17 00:00:00 2001 From: AnthonyAxenov Date: Fri, 22 Nov 2024 09:32:22 +0800 Subject: [PATCH] frkn tool -- toggle ipv6 on (dis)connect --- tools/frkn.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tools/frkn.sh b/tools/frkn.sh index f2acf3f..a4cf3f6 100755 --- a/tools/frkn.sh +++ b/tools/frkn.sh @@ -1,13 +1,19 @@ #!/bin/bash function disconnect() { - echo "Connecting to $1" + echo "Disconnecting: $1" sudo wg-quick down "$1" + sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1 + sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1 + sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=1 echo } function connect() { - echo "Disconnecting frkn-$1" + echo "Connecting: frkn-$1" + sudo sysctl -w net.ipv6.conf.all.disable_ipv6=0 + sudo sysctl -w net.ipv6.conf.default.disable_ipv6=0 + sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=0 sudo wg-quick up "frkn-$1" echo } @@ -55,7 +61,7 @@ Endpoint = $peer_endpoint PersistentKeepalive = 25 EOF done - sudo mv ./frkn-*.conf /etc/wireguard/ + sudo mv -f ./frkn-*.conf /etc/wireguard/ } command="$1"