Skip to content

christopheraseidl/ovpn-wrapper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenVPN Wrapper

OpenVPN Wrapper simplifies OpenVPN terminal commands and profile management.

Installation

You can install this package very easily after downloading it:

cd /path/to/this/package
chmod +x vpn
sudo ./vpn install

The install command does the following:

  • Installs vpn at /usr/local/bin/vpn.
  • Creates a configuration directory at /etc/vpn.d, where the configuration file and OpenVPN profiles live.
  • Creates a configuration file, /etc/vpn.d/vpn.conf.
  • Checks that ovpn is installed (for which this package functions as a wrapper).
  • Displays a message showing how to use the wrapper.

Usage

Note that, once you have installed the script and added at least one OpenVPN profile, you can simply connect by running sudo vpn, without any additional commands. Otherwise, you can specify the profile you want to connect with using sudo vpn connect PROFILE, where "PROFILE" appears in the file name of the profile.

When connecting with or updating a default profile, note that you should specify a string that appears in the file name; it is case-insensitive. E.g. if you have a profile "MadridConnectionA.ovpn," the following commands all work:

sudo vpn connect Madrid
sudo vpn connect madrid
sudo vpn default madrid

Commands

Command Description
-c, connect PROFILE Connect to specified profile
list List available profiles
add PROFILE Add a new OpenVPN profile from the specified path
-d, default PROFILE Update default OpenVPN profile
-u, user Update username
-p, password Update password
help Show a list of commands and how to use them
install Perform initial installation and setup
uninstall Uninstall the script and configuration files

Testing

You may test this package by cloning it and then running:

cd /path/to/package
chmod +x test.sh
./test.sh

This will provide you with a Dockerized shell to interact with and test the script.

To test with OpenVPN profiles, add them to a test-profiles subdirectory before running test.sh. You can then access them inside the Docker container at /test-profiles.

Uninstallation

You can uninstall this package very easily:

sudo vpn uninstall

This will, after prompting for confirmation, delete the script from /usr/local/bin as well as the configuration directory and all files contained therein, located at /etc/vpn.d. Once confirmed, this step is irreversible, so the configuration file and all OpenVPN profiles will be lost.

About

A convenient wrapper for opvn that simplifies commands and profile management.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors