Detect interfaces on multiple distributions (fixes #25)

This modification will allow users that use specific distributions (example: Ubuntu 18.04) to use the OpenVPN scripts without getting any strange behavior on interface detection.
This commit is contained in:
iPherian 2020-11-01 04:14:51 -08:00 committed by GitHub
parent 82ebed7c9c
commit 58f7ed3ad2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -37,10 +37,10 @@ check_tool openvpn
# Check if manual PIA OpenVPN connection is already initialized. # Check if manual PIA OpenVPN connection is already initialized.
# Multi-hop is out of the scope of this repo, but you should be able to # Multi-hop is out of the scope of this repo, but you should be able to
# get multi-hop running with both OpenVPN and WireGuard. # get multi-hop running with both OpenVPN and WireGuard.
adapter_check="$( ip a s tun06 )" adapter_check="$( ip a s tun06 2>&1 )"
should_read="Device \"tun06\" does not exist" should_read="Device \"tun06\" does not exist"
pid_filepath="/opt/piavpn-manual/pia_pid" pid_filepath="/opt/piavpn-manual/pia_pid"
if [[ "$adapter_check" != "$should_read" ]]; then if [[ "$adapter_check" != *"$should_read"* ]]; then
echo The tun06 adapter already exists, that interface is required echo The tun06 adapter already exists, that interface is required
echo for this configuration. echo for this configuration.
if [ -f "$pid_filepath" ]; then if [ -f "$pid_filepath" ]; then