What-is-my-IP

Network

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

0
Score 61%
Description:

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

14 years ago

A simple bash script accomplishes this task as well...

#!/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

14 years ago

An even simpler script:

-------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

14 years ago

Just for fun ;)
with one line :

MYIP=`lynx --dump "http://checkip.dyndns.org/" | gawk '{print $4}'`

Report

hds

14 years ago

would be cool if someone could do a python script for superkaramba ;)

Report

C

TheOneAndOnlyFoo

14 years ago

yes, make me down, make me all down... :(

Report

va3rcc

14 years ago

Good! Great little helper.
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

14 years ago

going to dyndns or no-ip would solve this issue as well. =)

Report

MMax

14 years ago

ammm dude, just type ifconfig and you'll see your IP ;)

Report

uga

14 years ago

Let me guess... your IP address is 192.168.1.2? ;)

Your method works only if your address isn't sitting behind a router that is shared by many connections

Report

C

TheOneAndOnlyFoo

14 years ago

sit down behind a router and try it again... i dont think, it will give you the real ip... maby the one from eth0 but not the ip fromt the router.. and i need this one, so i wrote this program

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

14 years ago

quote :)

Report

product-maker 16 28

File (click to download) Version Description PackagetypeArchitecture Downloads Date Filesize DL OCS-Install
Pling
*Needs ocs-url or ocs-store to install things
Details
license
version
1.0
updated Oct 25 2004
added Oct 25 2004
downloads today
0
page views today 2
System Tags app software