diff --git a/ifpublic/ifpublic b/ifpublic/ifpublic index 4cade4d..48b181b 100755 --- a/ifpublic/ifpublic +++ b/ifpublic/ifpublic @@ -10,15 +10,10 @@ http://ifconfig.io/ PUBLIC_IP_FETCH_URL="https://icanhazip.com" PUBLIC_IP6_FETCH_URL="$PUBLIC_IP_FETCH_URL" -pscat \ - [ curl -4 --connect-timeout 5 --silent "$PUBLIC_IP_FETCH_URL" \ - ] \ - [ printf ' / ' ] \ - [ curl -6 --connect-timeout 5 --silent \ - "$PUBLIC_IP6_FETCH_URL" ] \ - | tr -d '\n' \ - | xargs echo \ - | sed 's/ \/$//g' \ - | sed 's/^\/ //g' +printf "%s / %s\n" \ + "$(curl -4 --connect-timeout 5 --silent "$PUBLIC_IP_FETCH_URL")" \ + "$(curl -6 --connect-timeout 5 --silent "$PUBLIC_IP6_FETCH_URL")" \ + | sed 's/ \/ $//g' \ + | sed 's/^ \/ //g' exit 0