
What-is-my-IP
Source (link to git-repo or to original if based on someone elses unmodified work): Add the source-code for this project on opencode.net
Prints out your Internet-IP
I have an apache and if i want to share files with my friends, everytime i have to go to sites like www.whatismyip.de and copy and past the ip. now i only start a script and voila...
viron
16 years ago
#!/bin/bash
wget http://checkip.dyndns.org 1>/dev/null 2>/dev/null
MYIP=`cat index.html | cut -d: -f2 | cut -d\< -f1`
rm index.html
echo "My WAN address is: $MYIP"
exit 0
Report
thegeekster
16 years ago
-------begin---------
#!/bin/sh
echo "My Internet IP is: "`wget -qO- http://checkip.dyndns.org/ | sed 's|.*Â \([[:digit:]]*\.[[:digit:]]*\.[[:digit:]]*\.[[:digit:]]*\).*|\1|'`
-------end-----------
This is a one-liner, and note the space immediatly following "s|.* " :-)
Report
bobuse
16 years ago
with one line :
MYIP=`lynx --dump "http://checkip.dyndns.org/" | gawk '{print $4}'`
Report
hds
16 years ago
Report
TheOneAndOnlyFoo
16 years ago
Report
va3rcc
16 years ago
For those not using dynamic ip services the host command will not work. So it beats bringing up a browser to check the router. Of course if you have no router access rights then this fits the bill very nicely.
Report
viron
16 years ago
Report
MMax
16 years ago
Report
uga
16 years ago
Your method works only if your address isn't sitting behind a router that is shared by many connections
Report
TheOneAndOnlyFoo
16 years ago
linux:/home/Foo # ifconfig
eth0 Protokoll:Ethernet Hardware Adresse 00:40:95:30:87:DC
inet Adresse:192.168.0.1 Bcast:192.168.0.255 Maske:255.255.255.0
inet6 Adresse: fe80::240:95ff:fe30:87dc/64 G
Report
SWaN
16 years ago
Report