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
5 .0
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

15 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

15 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

15 years ago

Just for fun ;)
with one line :

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

Report

hds

15 years ago

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

Report

C

TheOneAndOnlyFoo

15 years ago

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

Report

va3rcc

15 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

15 years ago

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

Report

MMax

15 years ago

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

Report

uga

15 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

15 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

15 years ago

quote :)

Report

12345678910
product-maker Base: 4 x 5.0 Ratings
Be the first to comment
File (click to download) Version Description PackagetypeArchitectureRelease Channel Downloads Date Filesize DL OCS-Install MD5SUM
*Needs pling-store or ocs-url to install things
Pling
0 Affiliates
Details
license
version
1.0
updated Oct 25 2004
added Oct 25 2004
downloads 24h
0
mediaviews 24h 0
pageviews 24h 0
System Tags app software