diff --git a/wireguard/.scripts/vpn-switch.sh b/wireguard/.scripts/vpn-switch.sh new file mode 100755 index 0000000..5294185 --- /dev/null +++ b/wireguard/.scripts/vpn-switch.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +### +# Switch wireguard vpns up/down +### + +STATUS="$(nmcli device status | grep -c wg0)" + +case $STATUS in + 1) + sudo wg-quick down wg0 + sudo wg-quick down wg1 + ;; + *) + sudo wg-quick up wg0 + sudo wg-quick up wg1 + ;; + esac