Read and respond to this message at:
https://sourceforge.net/forum/message.php?msg_id=6025653
By: lnxgnome
I'm using SNMP to get the external IP address directly from my Billion router,
which is then used by ddclient.
I'm one of those unfortunate enough to live in a country where internet censorship
is already an art form, so I can't use a web based service like checkip.org
(because they're all blocked). Even access to the regular ports used by my
dynamic dns service provided are blocked. Makes using ddclient very
interesting.
Using use=web directly to this router doesn't seem to work well, because "IP
Address" appears more than one time on the page containing the IP needed, and
ddclient grabs the wrong address (an internal one), or can't find it at all.
IF ddclient could handle multiple web-skip entries on the same line, then it
might work. (use=web, web=router/welcome.html, web-skip='wan', web-skip='IP
Address')
so... fall back to SNMP, which works.
Some of the bashier modification suggested don't work....
CM="${2:=public}"
Fails because "2" is a bash position parameter, and cannot be redefined. You
could use:
TWO=$2
CM="${TWO:=public}"
The next line has a typo, and is missing the right ")", but is otherwise ok.
The 'set --' fails to do what we want, because snmpwalk returns multiple records
(one per interface, which in this case are 5 different addresses). You need
to reiterate(loop) over each IP to see if it belongs to the correct interface
(which is identified by $EXTIF).
note: $2 in awk is a awk variable, not a bash positional parameter.
--LnxGnome
______________________________________________________________________
You are receiving this email because you elected to monitor this forum.
To stop monitoring this forum, login to SourceForge.net and visit:
https://sourceforge.net/forum/unmonitor.php?forum_id=399427
|