Last active
January 26, 2018 10:07
-
-
Save cupracer/7372d804740a5f9b4e83f5de65442467 to your computer and use it in GitHub Desktop.
Update the timestamp of a Bind DNS zonefile
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/bash | |
if [ $# -ne 1 ]; then | |
echo "missing parameter" | |
exit 1 | |
fi | |
ZONEFILE=$1 | |
if ! [ -f $ZONEFILE ]; then | |
echo "$ZONEFILE does not exist" | |
exit 1 | |
fi | |
echo updating $ZONEFILE | |
sed -i 's/[0-9]\{10\}.*serial$/'`date +%Y%m%d%H`' ; serial/g' $ZONEFILE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment