dotfiles/bin/scripts/vpn-start

20 lines
659 B
Bash
Executable file

#!/usr/bin/env bash
# [[file:../../Guix.org::*vpn-start][vpn-start:1]]
export DISPLAY=:0
CONN=$(nmcli -f NAME con show --active | grep -Ev "(.*docker.*|NAME|br-.*|veth.*|tun.*|vnet.*|virbr.*)" | sed 's/ *$//g')
if [ -z "$CONN" ]; then
echo "No connection!"
notify-send "VPN" "No connection for VPN to run"
exit
fi
# if [[ "$CONN" != *"Wired"* ]]; then
# echo "Connection: $CONN"
# notify-send "VPN" "Initializing for connection: $CONN"
# pkexec nmcli con modify "$CONN" ipv6.method ignore
# nmcli connection up "$CONN"
# fi
pkexec openvpn --config ~/.vpn/mullvad_openvpn_linux_lv_rix/mullvad_lv_rix.conf
# vpn-start:1 ends here