From a91f6d392fb4c75d28239ecf62279be495b1488f Mon Sep 17 00:00:00 2001 From: Alan Garcia Date: Mon, 7 Mar 2011 10:15:38 +0000 Subject: [PATCH] Optimisation du reload --- src/update_domains.sh | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/update_domains.sh b/src/update_domains.sh index fd3b372e..8623e317 100644 --- a/src/update_domains.sh +++ b/src/update_domains.sh @@ -105,24 +105,24 @@ for dom in $( mysql_query "select domaine from domaines where dns_action = 'DELE done -# Concat the apaches files -tempo=$(mktemp "$VHOST_FILE.XXXXX") -find "$VHOST_DIR" -mindepth 2 -type f -iname "*.conf" -exec cat '{}' > "$tempo" \; -if [ $? -ne 0 ] ; then - log_error " web file concatenation failed" -fi -touch "$VHOST_FILE" -if [ ! -w "$VHOST_FILE" ] ; then - log_error "cannot write on $VHOST_FILE" -fi - -mv "$tempo" "$VHOST_FILE" - -# we assume we run apache and bind on the master if [ $RELOAD_WEB ] ; then RELOAD_ZONES="$RELOAD_ZONES apache" + + # Concat the apaches files + tempo=$(mktemp "$VHOST_FILE.XXXXX") + find "$VHOST_DIR" -mindepth 2 -type f -iname "*.conf" -exec cat '{}' > "$tempo" \; + if [ $? -ne 0 ] ; then + log_error " web file concatenation failed" + fi + touch "$VHOST_FILE" + if [ ! -w "$VHOST_FILE" ] ; then + log_error "cannot write on $VHOST_FILE" + fi + mv "$tempo" "$VHOST_FILE" + fi +# we assume we run apache and bind on the master /usr/bin/alternc_reload $RELOAD_ZONES || true for slave in $ALTERNC_SLAVES; do if [ "$slave" != "localhost" ]; then