OpenVPN Wrapper simplifies OpenVPN terminal commands and profile management.
You can install this package very easily after downloading it:
cd /path/to/this/package
chmod +x vpn
sudo ./vpn installThe install command does the following:
- Installs
vpnat/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
ovpnis installed (for which this package functions as a wrapper). - Displays a message showing how to use the wrapper.
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| 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 |
You may test this package by cloning it and then running:
cd /path/to/package
chmod +x test.sh
./test.shThis 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.
You can uninstall this package very easily:
sudo vpn uninstallThis 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.