Skip to content

Instantly share code, notes, and snippets.

@lmasiero
Forked from thanhtunguet/auto-ovpn.sh
Last active October 17, 2022 21:14
Show Gist options
  • Save lmasiero/b1608ad904e57889dbe81fbf4ac5e34c to your computer and use it in GitHub Desktop.
Save lmasiero/b1608ad904e57889dbe81fbf4ac5e34c to your computer and use it in GitHub Desktop.
Auto reconnect OpenVPN
#!/bin/bash
function getStatus () {
ifconfig | grep $1 && return 1
return 0
}
getStatus tun0
if [[ $? == 0 ]];
then
openvpn /opt/client.ovpn
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment