Skip to content

Instantly share code, notes, and snippets.

@antoniy
antoniy / vpn-auto-reconnect.sh
Last active February 4, 2022 09:04
Auto reconnect to OpenVPN via NetworkManager
#!/bin/bash +x
# Source: http://www.gabsoftware.com/tips/automatically-reconnect-to-your-vpn-on-linux/
# Description:
# Make the script executable "chmod +x /path/to/the/script.sh
# Put the script in .profile or .bashrc so it can be run on user login:
# Example: echo "/path/to/the/script.sh start &" >> .bashrc
# The script can be bound to shortcut keys with these commands:
# /path/to/the/script.sh start # starts and monitors VPN connection