Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/johanneszab/vpn-auto-reconnect.sh
A simple bash script for autoreconnect to OpenVPN via NetworkManager command-line (nmcli).
https://github.com/johanneszab/vpn-auto-reconnect.sh
auto-reconnect bash linux nmcli openvpn reconnect script shell
Last synced: about 3 hours ago
JSON representation
A simple bash script for autoreconnect to OpenVPN via NetworkManager command-line (nmcli).
- Host: GitHub
- URL: https://github.com/johanneszab/vpn-auto-reconnect.sh
- Owner: johanneszab
- Created: 2014-12-17T16:32:25.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2022-04-10T16:10:29.000Z (over 2 years ago)
- Last Synced: 2023-05-26T17:20:15.929Z (over 1 year ago)
- Topics: auto-reconnect, bash, linux, nmcli, openvpn, reconnect, script, shell
- Language: Shell
- Homepage:
- Size: 9.77 KB
- Stars: 25
- Watchers: 1
- Forks: 6
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# vpn-auto-reconnect.sh
A simple bash script for autoreconnect to OpenVPN via NetworkManager command-line (nmcli).
---
## Usage:
1. Clone the repository:
```bash
git clone https://github.com/johanneszab/vpn-auto-reconnect.sh.git
```2. Change directory inside that directory:
```bash
cd vpn-auto-reconnect.sh
```3. Make the script **executable**
```bash
chmod +x vpn-auto-reconnect.sh
```4. Copy `vpn-config-sample.sh` to `vpn-config.sh`. Simply run
```bash
cp vpn-config-sample.sh vpn-config.sh
```5. Configure `vpn-config.sh`. All the needed info on how to do that, is shown in the **config comments**.
6. Start monitoring VPN connection
```bash
./vpn-auto-reconnect.sh start
```7. Stop the monitoring and also the VPN connection
```bash
./vpn-auto-reconnect.sh stop
```---
## Source:
[**nmcli**](https://wiki.gnome.org/Projects/NetworkManager/nmcli)
[**Source**](http://www.gabsoftware.com/tips/automatically-reconnect-to-your-vpn-on-linux/)
[**Fork from**](https://gist.github.com/antoniy/f925ae55410a092c9e75/) 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`:
```bash
chmod +x vpn-toggle.sh
./vpn-toggle.sh
```