From 21d7e72919b032bed3eb0c8d17550ee474814e2a Mon Sep 17 00:00:00 2001 From: Harry Wixley Date: Mon, 22 May 2023 21:50:31 +0100 Subject: [PATCH] wix-cli quick commit --- wix-cli.sh | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/wix-cli.sh b/wix-cli.sh index 6de7d19..057e50d 100755 --- a/wix-cli.sh +++ b/wix-cli.sh @@ -750,7 +750,24 @@ elif [ "$1" = "ip" ]; then hostname -I echo "" info_text "Public IP:" - curl ifconfig.co/ + public_ip=$(curl ifconfig.co/json) + ip=$(echo "$public_ip" | jq -r '.ip') + city=$(echo "$public_ip" | jq -r '.city') + region=$(echo "$public_ip" | jq -r '.region_name') + zip=$(echo "$public_ip" | jq -r '.zip_code') + country=$(echo "$public_ip" | jq -r '.country') + lat=$(echo "$public_ip" | jq -r '.latitude') + long=$(echo "$public_ip" | jq -r '.longitude') + time_zone=$(echo "$public_ip" | jq -r '.time_zone') + asn_org=$(echo "$public_ip" | jq -r '.asn_org') + echo "" + echo "IP: $ip" + echo "" + echo "${ORANGE}Address:${RESET} $city, $region, $zip, $country" + echo "${ORANGE}Latitude & Longitude:${RESET} ($lat, $long)" + echo "${ORANGE}Timezone:${RESET} $time_zone" + echo "${ORANGE}ASN Org:${RESET} $asn_org" + echo "" info_text "Eth0 MAC Address:" cat "/sys/class/net/$(ip route show default | awk '/default/ {print $5}')/address"