You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

13 lines
229 B

#!/bin/sh
curl_ret=$(curl -s https://ipinfo.io)
awk_state="/\"$1\"/ {print \$2}"
#echo "CR: $curl_ret"
#echo "AS: $awk_state"
if [ "$1" == "" ]; then
echo "$curl_ret"
else
echo "$curl_ret"| awk "$awk_state"| tr -d [\",]
fi