Skip to content

Commit

Permalink
print ip to screen and fix return
Browse files Browse the repository at this point in the history
  • Loading branch information
duksis committed Feb 18, 2020
1 parent 889dba2 commit cbf78f7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions orb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,17 @@ commands:
- run:
name: Connect to VPN
command: |
wget -qO- http://checkip.amazonaws.com > initial.ip
wget -qO- http://checkip.amazonaws.com | tee 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)" ]
wget -qO- http://checkip.amazonaws.com | tee final.ip
if [ "$(cat initial.ip)" == "$(cat final.ip)" ]
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
exit 1
fi
cat openvpn.log
disconnect:
Expand Down

0 comments on commit cbf78f7

Please sign in to comment.