Skip to content

Instantly share code, notes, and snippets.

@fritz0705
Created November 10, 2010 18:55
Show Gist options
  • Select an option

  • Save fritz0705/671315 to your computer and use it in GitHub Desktop.

Select an option

Save fritz0705/671315 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Usage: checkzone NS_SERVER DOMAIN SERIAL_NUMBER
for i in $*
do
if [ "$i" = "--help" ]
then
echo "Usage: checkzone NS_SERVER DOMAIN SERIAL_NUMBER"
exit
fi
done
while true
do
var_host=`dig @$1 SOA $2 | grep SOA | grep -v ";" | awk '{print $7}'`
if [ "$var_host" = "$3" ]
then
echo "Server was updated."
echo $var_host
break
fi
sleep 60
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment