Answer the question
In order to leave comments, you need to log in
How to find WAN IP WiFi points without using ssh/telnet?
There is this bash code:
myip() {
local intIP=$(ssh [email protected] 'ifconfig ppp0 | grep inet | awk '"'"'{gsub("addr:", "", $2); print $2}'"'"'')
local extIP=$(curl -s icanhazip.com)
local pattern='[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*$'
if expr "$intIP" : "$pattern" >/dev/null; then
if expr "$extIP" : "$pattern" >/dev/null; then
if [ "$extIP" != "$intIP" ]; then
echo "$intIP - grey IP"
else
echo "$intIP - white IP"
fi
fi
fi
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question