add TODO in main process

This commit is contained in:
Alexandre CATTEAU 2022-02-15 18:01:25 +01:00
parent 04f515f995
commit 5860ea25a9

View File

@ -17,6 +17,12 @@ if [[ ! "$MYIP" =~ ^([1-9]?[0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.([1-9]?[0-9]|1[
fi
# fetch current record with dig, and choose what to do
# TODO we should probably improve this choice: current implementation prevents hosts that do not have a record yet to register themselves; We'd need to differentiate cases:
# * correct ip, not the same -> OK, need to update
# * correct ip, the same -> OK, nothing to do
# * no result, name server was reachable -> OK, need to register
# * no result, name server was not reachable -> NOK, abort
# * result which is not a correct ip -> NOK, abort
current_ip_record=$(dig $FQDN +short)
if [[ "$current_ip_record" =~ ^([1-9]?[0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.([1-9]?[0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.([1-9]?[0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.([1-9]?[0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$ ]]; then
if [[ ! "$MYIP" = "$current_ip_record" ]]; then