Skip to content

Instantly share code, notes, and snippets.

@atais
Last active May 23, 2024 09:11
Show Gist options
  • Save atais/e5477e46048f83680e71baa6e44b80f1 to your computer and use it in GitHub Desktop.
Save atais/e5477e46048f83680e71baa6e44b80f1 to your computer and use it in GitHub Desktop.
Check if ip is up to date
#/bin/sh
CIP=$(curl -s https://api.ipify.org/?format=json | jq .ip -r)
DIP=$(nslookup domain.pl ns107.ovh.net | awk '/^Address: / { print $2 }')
if [ "$CIP" != "$DIP" ] ; then
echo "[$(date)] $CIP != $DIP"
/share/CE_CACHEDEV1_DATA/Web/ddns/ddns-update $CIP
else
echo "[$(date)] $CIP == $DIP"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment