From cbf78f72bf6d48a3c2885756ed446813d13806a4 Mon Sep 17 00:00:00 2001 From: Hugo Duksis Date: Tue, 18 Feb 2020 14:44:02 +0100 Subject: [PATCH] print ip to screen and fix return --- orb.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/orb.yml b/orb.yml index d50d533..d8bd318 100644 --- a/orb.yml +++ b/orb.yml @@ -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: