Last active
August 7, 2025 13:38
-
-
Save InFog/f73f974d42d59882733fd5f44469933d to your computer and use it in GitHub Desktop.
Revisions
-
InFog revised this gist
Aug 7, 2025 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,10 +1,10 @@ # Remember to first import the config into openvpn3. Change the $CONFIG_NAME into name that makes sense to you # openvpn3 config-import --config profile.ovpn --name $CONFIG_NAME # Add the code below to your shell's .rc file. Replace the strings below with the proper values. # - $CONFIG_NAME # - EMAIL_ADDRESS # - BASE64_ENCODED_PASSWORD - To avoid exposing your password vpn-off () { openvpn3 session-manage --config $CONFIG_NAME --disconnect 2> /dev/null -
InFog revised this gist
Aug 7, 2025 . 1 changed file with 8 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,11 @@ # Remember to first import the config into openvpn3. Change the $CONFIG_NAME into name that makes sense to you # openvpn3 config-import --config profile.ovpn --name $CONFIG_NAME # Replace # - $CONFIG_NAME # - EMAIL_ADDRESS # - BASE64_ENCODED_PASSWORD vpn-off () { openvpn3 session-manage --config $CONFIG_NAME --disconnect 2> /dev/null printf "Disconnected from VPN.\n" -
InFog created this gist
Aug 7, 2025 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,24 @@ vpn-off () { openvpn3 session-manage --config $CONFIG_NAME --disconnect 2> /dev/null printf "Disconnected from VPN.\n" } vpn-on () { if [ -z "$1" ]; then echo "Usage: vpn-on <2FA code>\n"; else vpn-off printf "Connecting to VPN.\n" printf "EMAIL_ADDRESS\n$(echo "BASE64_ENCODED_PASSWORD==" | base64 --decode)\n$1" | openvpn3 session-start --config $CONFIG_NAME printf "Connected to VPN.\n" fi } vpn-status () { if [ -z "$(openvpn3 sessions-list | grep "Client connected")" ]; then printf "VPN is disconnected.\n"; else printf "VPN is connected.\n"; fi }