- Most Recent |
24 hours |
7 days |
30 days |
365 days |
HowFlow —
Sometimes you want to write a script that needs the external IP of the router your client is connected to. Here are three possible solutions.
Posted by
aroedl 2 months ago
aroedl 2 months ago Solution 1: wget and whatsmyip.com
#!/bin/sh
IP=`wget -q -O - http://whatismyip.com/automation/n09230945.asp`
echo $IP
Solution 2: wget and freeshell.org
#!/bin/sh
IP=$( wget -qO - http://cfaj.freeshell.org/ipaddr.cgi )
echo $IP
Solution 3: lynx and freeshell.org
#!/bin/sh
IP=$( lynx -dump http://cfaj.freeshell.org/ipaddr.cgi )
echo $IP
Please log in or sign up and vote for this trick if it was helpful for you.
Don't forget to subscribe to our
RSS/Atom feed to get the latest tricks.
Don't forget to subscribe to our
RSS/Atom feed to get the latest tricks.








