Last active
May 23, 2024 09:11
-
-
Save atais/e5477e46048f83680e71baa6e44b80f1 to your computer and use it in GitHub Desktop.
Check if ip is up to date
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/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