Skip to content
This repository has been archived by the owner on Feb 4, 2020. It is now read-only.

Connection test based on IP change may be wrong in some cases #191

Open
Tamaranch opened this issue Jul 2, 2019 · 0 comments
Open

Connection test based on IP change may be wrong in some cases #191

Tamaranch opened this issue Jul 2, 2019 · 0 comments

Comments

@Tamaranch
Copy link
Contributor

I had the case recently using my phone as a modem: my IP changed during the openvpn connection process. But in the code, we have:

if [[ ("$current_ip" != "$new_ip") && ("$new_ip" != "Error.") ]]; then
  echo "[$] Connected!"
  echo "[#] New IP: $new_ip"

So pvpn concluded that I was connected when it was not!
A complementary test should be added, such as

if [[ ("$current_ip" != "$new_ip") && ("$new_ip" != "Error.") && grep -q "route add $new_ip" "$connection_logs" ]]; then
  echo "[$] Connected!"
  echo "[#] New IP: $new_ip"

I don't know if it's really the right way to do it, so I do not propose a PR, but something should probably be done.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant