Skip to content

Instantly share code, notes, and snippets.

@mjtiempo
Created November 25, 2022 02:41
Show Gist options
  • Select an option

  • Save mjtiempo/8e17f48c9fd5cec17e867d99d0b07c85 to your computer and use it in GitHub Desktop.

Select an option

Save mjtiempo/8e17f48c9fd5cec17e867d99d0b07c85 to your computer and use it in GitHub Desktop.

Revisions

  1. mjtiempo created this gist Nov 25, 2022.
    14 changes: 14 additions & 0 deletions openvpn3-cmd.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    #import config
    openvpn3 config-import --config myvpnfile.ovpn

    #show list of reusable configs
    openvpn3 configs-list

    #list active connection
    openvpn3 sessions-list

    #connect using config already imported
    openvpn3 session-start --config-path $(openvpn3 configs-list | grep /net)

    #disconnect current active session
    openvpn3 session-manage --disconnect --session-path $(openvpn3 sessions-list | grep -oP '(?<=Path: )\/net\/openvpn\/v3\/sessions\/\w+')