SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2014-04-23 21:44:29

Joe90
#! Junkie
Registered: 2013-10-10
Posts: 337

[Tip] What is My IP (for when DynDys.org stops being free!)

Been using dyndys.org for years in order to follow my home server ip (don't have static at home). But dyndys are now changing their business model and want to charge for the service. I could have done a search and found another redirecting host, but thought it would be more useful to do it myself. For this to work you will need to have some hosting space online that you can ftp to. So on your home server:

1. cd $HOME
2. Create empty file: touch ipaddy.txt
3. Create script with nano and save to home, and make executable (chmod +x file)

#!/bin/bash
cd $HOME

##this fetches your external ip address
myip=$(wget http://smart-ip.net/myip -O - -q)
##this gets the current date and time
curdat=$(date)
##this appends the above on one line to the file created
echo $curdat" "$myip >> $HOME/ipaddy.txt

##ftp host, user and pass
HOST='********'
USER='*********'
PASSWD='*********'

ftp -n -v $HOST << EOT
ascii
user $USER $PASSWD
prompt
##directory on ftp host where you want the file
cd **********
put ipaddy.txt
bye
EOT
sleep 12

You can now browse to your file and find your current home server ip address, it will be the last in the list e.g.

http://joe90/myip/ipaddy.txt

and your address will be returned so you can ssh, login etc.

You can create a cronjob to run the script, suggest every hour or so, depending on your needs


There are bound to be 100 better ways to do this wink

Offline

Be excellent to each other!

#2 2014-04-24 00:31:10

codingman
#! Junkie
From: Darkstar
Registered: 2013-03-22
Posts: 356

Re: [Tip] What is My IP (for when DynDys.org stops being free!)

Try:

ifconfig

U iz not goin to getz an anzer frm me if u tip lik dis  mad

Offline

#3 2014-04-24 04:18:28

phoenixx
Member
Registered: 2014-04-20
Posts: 47

Re: [Tip] What is My IP (for when DynDys.org stops being free!)

i'm not sure what the simpler native way to roll your own is, but that looks pretty cool to me. what language is that script in? is it a bash script?

Offline

#4 2014-04-24 23:27:41

codingman
#! Junkie
From: Darkstar
Registered: 2013-03-22
Posts: 356

Re: [Tip] What is My IP (for when DynDys.org stops being free!)

Yes, that is a shell script, hence the #!/bin/bash.


U iz not goin to getz an anzer frm me if u tip lik dis  mad

Offline

#5 2014-04-26 00:13:21

Joe90
#! Junkie
Registered: 2013-10-10
Posts: 337

Re: [Tip] What is My IP (for when DynDys.org stops being free!)

As you know, ifconfig will give me my internal LAN ip, not much help if I am seeking to login into my server from outside the LAN smile

Offline

#6 2014-04-26 00:37:27

Bearded_Blunder
#! Junkie
Registered: 2014-04-04
Posts: 262

Re: [Tip] What is My IP (for when DynDys.org stops being free!)

or just switch to no-ip


Blessed is he who expecteth nothing, for he shall not be disappointed...

Offline

#7 2014-04-26 00:46:58

codingman
#! Junkie
From: Darkstar
Registered: 2013-03-22
Posts: 356

Re: [Tip] What is My IP (for when DynDys.org stops being free!)

^^I see, I was more or less replying to the title, which did not aqcuire such a level of specificity.


U iz not goin to getz an anzer frm me if u tip lik dis  mad

Offline

#8 2014-04-26 05:18:14

mynis01
#! Die Hard
From: 127.0.0.1
Registered: 2010-07-02
Posts: 2,005

Re: [Tip] What is My IP (for when DynDys.org stops being free!)

There's a script in the AUR that emails you your new IP address any time it bounces. I'm sure it could be adapted to run on debian, check it out: https://aur.archlinux.org/packages/checkip/

Offline

#9 2014-04-27 00:28:12

Joe90
#! Junkie
Registered: 2013-10-10
Posts: 337

Re: [Tip] What is My IP (for when DynDys.org stops being free!)

Well it works, just checked the webpage, and a change this morning:

Sat Apr 26 10:00:01 BST 2014 8*.1*9.1*2.*13
Sat Apr 26 11:00:01 BST 2014 *6.17*.10*.23*

and thanks for the link mynis01, it threw up a few more sites that issue your ip

:~$ curl -s http://www.whatsmyip.us/
:~$ curl -s http://icanhazip.com/
:~$ curl -s http://ifconfig.me/

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.
Server: acrobat

Debian Logo