diff --git a/connect_to_openvpn_with_token.sh b/connect_to_openvpn_with_token.sh index 9e15b18..f850727 100755 --- a/connect_to_openvpn_with_token.sh +++ b/connect_to_openvpn_with_token.sh @@ -37,10 +37,10 @@ check_tool openvpn # 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 # 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" 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 for this configuration. if [ -f "$pid_filepath" ]; then