Register
It is currently Sun Nov 23, 2014 11:11 pm

function to get your external IP address


All times are UTC - 6 hours


Post new topic Reply to topic  [ 3 posts ] 
Author Message
 PostPosted: Tue May 17, 2005 10:34 am   
Site Admin
User avatar

Joined: Sun May 15, 2005 9:36 pm
Posts: 673
Location: Des Moines, Iowa
Originally posted by jbsnake
useful for when you don't have a dns name and you want someone to connect to your server :)

or just wanting to know at a glance (ofcourse you have to be connected to the internet for it to work)

Code:
alias getip='IPADDY=`wget -q http://www.whatismyip.com/ -O /dev/stdout | grep "Your IP is" | tr -c ".[:digit:]" "\n" | grep -e "[0-9][0-9]*[.][0-9][0-9]*[.][0-9][0-9]*[.][0-9][0-9]*"` > /dev/null; echo "Your IP is: $IPADDY"'


i have this in my ~/.bashrc ofcourse :)


Top
 Profile WWW  
 PostPosted: Tue May 17, 2005 10:35 am   
Site Admin
User avatar

Joined: Sun May 15, 2005 9:36 pm
Posts: 673
Location: Des Moines, Iowa
Originally posted by Mekanik
A shorter lynx version is below:

Code:
alias getip="echo Your IP Address:  $(lynx -dump http://www.whatismyip.com | awk '/Your IP is/{print $4}')"


:D

-mekanik


Top
 Profile WWW  
 PostPosted: Tue May 17, 2005 10:35 am   
Site Admin
User avatar

Joined: Sun May 15, 2005 9:36 pm
Posts: 673
Location: Des Moines, Iowa
well, mine isn't so much a bashscript :) But I stuck something similar on usalug.org


http://usalug.org/phpBB2/whats_my_ip_address.php


Top
 Profile WWW  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP