Carlos E. R. wrote:
On 10/02/2019 17.43, gumb wrote:
I've mentioned this in threads once or twice before and I believe it was Per Jessen who proposed a wget one-liner, but after digging through the list archives and searching for an example, I'm not finding the exact thing I need.
I need ssh access to a remote machine whose IP address is dynamic. Knowing nothing about scripting, I'd like to install a simple, minimal script on the remote machine that does the following:
1. checks on a regular basis, let's say every hour, for the current IP address 2. if the address has changed, and ONLY if it has changed, email me the new address
I assume the address will need to be written to a file somewhere to be compared with on each check.
Any suggestions?
I have such a script, yes. But mine gets the address by asking my current router. Not every hour, but every five minutes.
If you use a dynamic DNS server, you also need the script, unless you get one that is directly supported by your router.
Many routers have a generic setup for dynamic DNS. No local scripting needed. If you have to run wget/curl from cron, you usually don't need to know your own address. -- Per Jessen, Zürich (2.9°C) http://www.hostsuisse.com/ - dedicated server rental in Switzerland. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org