Skip to content

Commit

Permalink
Check piblic IP before and after connecting to VPN
Browse files Browse the repository at this point in the history
  • Loading branch information
duksis committed Feb 11, 2020
1 parent 3b0e710 commit 889dba2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions orb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,17 @@ commands:
- run:
name: Connect to VPN
command: |
wget -qO- http://checkip.amazonaws.com > initial.ip
sudo openvpn --config config.ovpn --auth-user-pass vpn.login > openvpn.log 2>&1 &
while [ -n "$(ip addr show tun0 2>&1 > /dev/null)" ]; do
sleep 0.1;
done
if [ "$(cat initial.ip)" == "$(wget -qO- http://checkip.amazonaws.com)" ]
then
echo "This computer's apparent public IP address was not different after connecting"
echo "This may mean that your VPN is not configured correctly."
return 1
fi
cat openvpn.log
disconnect:
description: "Disconnect from OpenVPN"
Expand Down

0 comments on commit 889dba2

Please sign in to comment.