Changeset 9954 in genesis
- Timestamp:
- Feb 14, 2012, 9:38:37 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/fresh-dns.sh
r9525 r9954 3 3 # Deploy fresh/changed WL autogenerated DNS zones 4 4 # 5 CONFIGROOT='/usr/local/www/wlconfig/nodes/' 5 GENESISROOT=`cd $(dirname $0)/..; pwd -P` 6 TOOLS="$GENESISROOT/tools" 7 CONFIG="$GENESISROOT/nodes" 8 STATIC="$GENESISROOT/dns" 6 9 DEPLOYROOT='/etc/namedb/master' 7 10 … … 9 12 trap "rm $TFILE; exit 1" 1 2 3 15 10 13 14 FORCE_UPDATE=${FORCE_UPDATE:-"no"} 15 ACTIVATE=${ACTIVATE:-"yes"} 16 11 17 # Generate new DNS and only complain/die on errors 12 18 ( 13 svn up $CONFIGROOT $CONFIGROOT/../dns|| exit 114 $CONFIGROOT/genesis-to-yaml.pl $CONFIGROOT/*/wleiden.conf || exit 115 $ CONFIGROOT/gformat.py dns || exit 119 #svn up $GENESISROOT || exit 1 20 #$TOOLS/genesis-to-yaml.pl $CONFIG/*/wleiden.conf || exit 1 21 $TOOLS/gformat.py dns || exit 1 16 22 ) 2>&1 > $TFILE || { cat $TFILE; exit 1; } 17 23 18 24 19 25 UPDATE_ZONES="" 20 # Check all zone files for updates21 for NEW in $CONFIG ROOT/dns/*; do26 # Check all zone files for vadility and updates 27 for NEW in $CONFIG/dns/*; do 22 28 ZONE=`basename $NEW | cut -c 4-` 23 29 OLD=$DEPLOYROOT/`basename $NEW` 24 30 25 # Contains new data? 26 diff -I 'SOA' $OLD $NEW 27 if [ $? -eq 0 ]; then 28 continue 31 # Syntax valid? 32 named-checkzone -q $ZONE $NEW 33 if [ $? -ne 0 ] ; then 34 echo "# ERROR: $ZONE FAILED" 35 else 36 echo "# INFO: $ZONE - OK" 29 37 fi 30 38 31 # Syntax valid? 32 named-checkzone $ZONE $NEW 33 if [ $? -ne 0 ] ; then 34 continue 39 if [ -r "$OLD" -a "$FORCE_UPDATE" = "no" ]; then 40 # Contains new data? 41 diff -I 'SOA' $OLD $NEW 42 if [ $? -eq 0 ]; then 43 continue 44 fi 35 45 fi 36 46 37 47 # Deploy 38 cp $NEW $OLD 39 UPDATE_ZONES="$UPDATE_ZONES $ZONE" 48 if [ "$ACTIVATE" = "yes" ]; then 49 cp $NEW $OLD 50 UPDATE_ZONES="$UPDATE_ZONES $ZONE" 51 fi 40 52 done 41 53
Note:
See TracChangeset
for help on using the changeset viewer.