-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Content-ID:
On 08/28/2013 06:02 AM, Carlos E. R. wrote:
You forgot to email to the list :-)
I have a trigger set on the router log; a script runs, and the IP is logged. I could use it to trigger a dynamic dns update if I used the service.
That sounds like a great idea, but I wouldn't know how to set up a router log or how to trigger it. Can you point me in the right direction to figure that out?
I'm not at home, so I can't look up the details. The idea is as follows: First, you configure the router to send the log to the computer. Many can do that, but some can not. If yours can't, then this can not be done. You have to detect if the router logs a certain message when it loses the connection and reconnects, or if the IP changes. Some even write the new IP to the log, which is fantastic. Then, you configure the syslog daemon to accept those messages and write them to a file. How to do that depends on which syslog daemon you have, because openSUSE has set different ones by default on each release. Next step is to make the syslog daemon detect a certain message pattern on the log; this is normally quite easy. Typical actions are to save that entry to a file or not to; but you can also trigger a call to an external command: that's what we are looking for. Well, the idea is precisely to trigger an script when the router sends the message that it is recovering the connection... if the message contains the IP, good; if not, a simple call to links to a certain web page that answers with the IP, and some trickery with sed, and you have the IP. I can fill the details probably this Thursday. And, in case this fails, have cron obtain the IP every... 8 hours? And at boot. - -- Cheers Carlos E. R. (from 11.4, with Evergreen, x86_64 "Celadon" (Minas Tirith)) -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (GNU/Linux) iF4EAREIAAYFAlIdObkACgkQja8UbcUWM1zhWAD/Yq0Mag2u54Tlg+k/6AP6ntdo DUi7xf62UCnFtCxKWooA/AlJnWxUayWnBawvgMo85fW2AxeRCCBew1aVtbojpCE0 =kWKL -----END PGP SIGNATURE-----