Created
June 5, 2020 07:57
-
-
Save anakaiti/f18d7a10db82f59e4db3eaf3bf2d127d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Selects and connects to a vpn | |
# Put .ovpn files in ~/vpn | |
function vpn --description 'Connect to vpn' | |
# Change to your prefered browser | |
set browser firefox | |
sudo -v | |
set ovpn ~/vpn/(ls ~/vpn/*.ovpn | tr '/' '.' | cut -d '.' -f 5 | fzf).ovpn | |
if test -e {$ovpn}.url | |
# If filename.ovpn.url exists, open the url inside the file | |
$browser (cat {$ovpn}.url) | |
end | |
sudo openvpn $ovpn | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment