Tuesday, October 21, 2008

MyName - A simple IP updater for dynDNS.it

MyName should work with many Unix versions, including Linux, BSD's, Mac OS X. If not let me know.

Download and installation

Latest version is Oct 26, 2008.

Download the myname script, place it in a directory included in your PATH. A suitable location is /usr/local/bin/ for Unix and /usr/bin for Mac OS X. Please ensure the executable bit is set.

Also download the configuration file myname.conf and place it under /etc/. Then edit this file to insert your username and password and the hostname(s) to update.

$ sudo mv myname /usr/local/bin/ $ sudo chmod a+x /usr/local/bin/myname

Go to http://dyndns.it/ if you need to register a new account. Edit myname.conf with a plain text editor. Save and complete install with:
$ sudo cp myname.conf /etc
$ sudo chown root:wheel \
/usr/local/bin/myname /etc/myname.conf

Note: root:wheel is the user and group suitable for Mac OS X and BSD's. Linux usually uses root:root.

Manual usage and testing

At the shell prompt just type:
$ myname

You should see a response similar to this:
good YOUR_IP

You can then try to resolve your host with:

If all goes well you should have receiveid a message like:

Automatic usage with modems

BSD, Linux, Mac OS X

As root, edit /etc/ppp/ip-up and add the myname command at the end on a line by itself. This way your IP will be registered every time your ADSL or PTSC connection is brought up by your modem. If this file does not exist please create it as root and ensure it is executable. This is the case with Mac OS X.

You can use these commands:
$ sudo echo myname >>/etc/ppp/ip-up
$ sudo chmod a+x /etc/ppp/ip-up

In Unix installations where sudo is not available, you can use
$ su

to become root. Then issue the same commands as above without the sudo prefix.

Automatic usage with routers



  • Oct 26, 2008: first version.


2442012 said...

I can't download the myname.conf

Farmboy said...

Fixed, thanks.

Marco Giglio said...

Ciao, non riesco ad installare il tuo script...mi spiego meglio: ho ubuntu 14.04lts, ho scaricato il file myname e l'ho spostato nella cartella /usr/local/bin e gli ho dato la spunta su "eseguibile". Ho scaricato e modificato il file myname.conf e l'ho salvato nella cartella /etc/.

Se su terminale do il comando myname mi restituisce questo errore:
marco@TvPc:~$ sudo myname
/usr/local/bin/myname: 47: /usr/local/bin/myname: fetch: not found

come posso risolvere? grazie mille!

Farmboy said...

Ciao Marco,
in effetti il comando fetch è tipico di FreeBSD e non esiste in Linux. Tuttavia se guardi alla linea 46 c'è una catena di elseif che testa per vedere quale comando hai per scaricare un file HTTP. iNon dovrebbe usare fetch se non ce l'hai. Cambia la prima riga dello script aggiungendo -x:

#!/bin/sh -x

e mandami l'output per vedere che succede.