Have a client with a dynamic IP address.
Every 5 minutes a script is executed that checks for a change in the external IP address through a CRON job
If the address has changed, then www.zoneedit.com is updated with the new IP address.Code:*/5 * * * * /var/data/bin/zoneedit.sh
This works but there maybe a 5 minute delay, at maximum, before the update takes place.Code:#!/bin/bash ipfile='/var/data/bin/ipaddress' [[ -f "$ipfile" ]] && ipold="$(< "$ipfile" )" ipnew="$( wget -q -O - checkip.dyndns.org | sed -e 's/.*Current IP Address: //;s/<.*$//' )" if [[ "$ipold" != "$ipnew" ]]; then...... fi
Are there any alternative ways to detect an external IP address change and thus cause the second part of the script to run?