Skip to content

Latest commit

 

History

History
61 lines (42 loc) · 1.34 KB

README.md

File metadata and controls

61 lines (42 loc) · 1.34 KB

vpn-auto-reconnect.sh

A simple bash script for autoreconnect to OpenVPN via NetworkManager command-line (nmcli).


Usage:

  1. Clone the repository:
git clone https://github.com/johanneszab/vpn-auto-reconnect.sh.git
  1. Change directory inside that directory:
cd vpn-auto-reconnect.sh
  1. Make the script executable
chmod +x vpn-auto-reconnect.sh
  1. Copy vpn-config-sample.sh to vpn-config.sh. Simply run
cp vpn-config-sample.sh vpn-config.sh
  1. Configure vpn-config.sh. All the needed info on how to do that, is shown in the config comments.

  2. Start monitoring VPN connection

./vpn-auto-reconnect.sh start
  1. Stop the monitoring and also the VPN connection
./vpn-auto-reconnect.sh stop

Source:

nmcli

Source

Fork from with changes for nmcli v0.9.10.

Script tested on fedora 21 with airvpn (OpenVPN).


vpn-toggle.sh

A simple bash script to toggle an OpenVPN connection on and off via NetworkManager command-line (mncli). You can use it instead of typing vpn-auto-reconnect.sh start/stop:

chmod +x vpn-toggle.sh
./vpn-toggle.sh