Email or username:

Password:

Forgot your password?
retiolus

Made a script that connects automatically my computer to #MullvadVPN when joining a new, unknown network.

If you disconnect from the network, it disconnects from #Mullvad VPN, and if you connect to a know/trusted network, it will ignore it and won't use the VPN.

codeberg.org/retiolus/scripts/

2 comments
PR ☮ ♥ ♬ 🧑‍💻

@retiolus if the script fails, where does it report?

Also: <shellcheck.net/>

$ shellcheck myscript

Line 32:
local active_connections=$(nmcli -t -f NAME,UUID con show --active | grep -v "mullvad")
^-- SC2155 (warning): Declare and assign separately to avoid masking return values.

Line 36:
local network_uuid=$(echo "$active_connections" | awk -F: '{print $2}')
^-- SC2155 (warning): Declare and assign separately to avoid masking return values.

Go Up