Mailinglist Archive: opensuse (1367 mails)

< Previous Next >
Re: [opensuse] maintaining dynamic ip addr, was: Writing coments on photos problem
On 2016-02-01 15:52, Patrick Shanahan wrote:
* Carlos E. R. <> [02-01-16 09:20]:

following might help :) ::

# <--------- Cool Functions by Crouse-------->
# Cool Functions for your .bashrc file.

#myip - finds your current IP if your connected to the internet
myip ()
lynx -dump -hiddenlinks=ignore -nolist | awk
'{ print $4 }' | sed '/^$/d; s/^[ ]*//g; s/[ ]*$//g'

Telcontar:~ # cat /usr/local/bin/whatismyIP

# Probar tres veces para conseguir la IP, a veces falla.
# Try up to three times because it can fail

echo "Intento $i"
set `wget -qO - | cut -d":" -f2 | cut -d"<" -f1 |
cut -d" " -f2`
if test -n "$*" ; then
echo "La IP actual es: " $*
echo "IP no encontrada, probando otra vez"
/bin/sleep 5
Telcontar:~ #

And I have a script from noip which queries my ip addr and reports
changes back to adjusting when necessary. The query runs every
10 minutes but miniminal system load and only reports changes which only
happen if I *reset* my modem/router (not power cycle) or there is an
extended network outage (which has happened) or I direct the router to
request a new ip addr.

Except for wide network outage, I cannot remember a time when my system
was inaccessable from the net :) (fingers crossed).

My ISP changes the IP on router reset or power cycle. On ADSL, a phone
disconnect does it. On fibre, I'm unsure.

Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 "Bottle" at Telcontar)

< Previous Next >