From 19f5c09c814fc68a2f5cadcf116839ecbf5a80cf Mon Sep 17 00:00:00 2001 From: Joerg Jaspert Date: Sun, 28 Sep 2008 11:50:54 +0200 Subject: Fixes - Use $LOGDIR where we want the dir and not the file - use $LOG where we want the file. - use proper "" around variables where they have to be Signed-off-by: Joerg Jaspert --- bin/runmirrors | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'bin/runmirrors') diff --git a/bin/runmirrors b/bin/runmirrors index 5c311de..3c397c6 100755 --- a/bin/runmirrors +++ b/bin/runmirrors @@ -23,7 +23,7 @@ set -e NAME="`basename $0`" # In case we are called with an argument we look for a different configuration. -if [ -n $1 ]; +if [ -n "$1" ]; then NAME="${NAME}-$1" fi @@ -50,20 +50,20 @@ MIRRORS=${MIRRORS:-"${HOME}/etc/${NAME}.mirror"} PROGRAM=${PROGRAM:-"${NAME}-$(hostname -s)"} # Make sure we have our log directory -mkdir -p ${LOG} +mkdir -p ${LOGDIR} # Some sane defaults cd ${HOME} umask 002 -trap 'log "Mirrorpush done"; ${SAVELOG} "${LOG}/runmirrors" > /dev/null' EXIT +trap 'log "Mirrorpush done"; ${SAVELOG} "${LOG}" > /dev/null' EXIT # Start log by redirecting everything there. -exec >"${LOG}/runmirrors" 2>&1 +exec >"${LOG}" 2>&1 log "Pushing leaf mirrors" -if [ -n ${HOOK1} ]; then +if [ -n "${HOOK1}" ]; then log "Running hook1: ${HOOK1}" ${HOOK1} result=$? @@ -80,6 +80,7 @@ egrep -v '^[[:space:]]*(#|$)' ${MIRRORS} | while read MLNAME MHOSTNAME MUSER MPROTO MKEYFILE; do if [ "x${MLNAME}x" = "xDELAYx" ]; then # We should wait a bit. + log "Delay of ${DELAY} seconds requested, sleeping" sleep ${DELAY} continue fi @@ -102,7 +103,7 @@ while read MLNAME MHOSTNAME MUSER MPROTO MKEYFILE; do log "Trigger ${MLNAME}" signal ${MLNAME} ${MHOSTNAME} ${MUSER} ${MPROTO} ${MKEYFILE} log "Trigger for ${MLNAME} done" - if [ -n ${HOOK2} ]; then + if [ -n "${HOOK2}" ]; then log "Running hook2: ${HOOK2}" ${HOOK1} result=$? @@ -110,7 +111,7 @@ while read MLNAME MHOSTNAME MUSER MPROTO MKEYFILE; do fi done -if [ -n ${HOOK3} ]; then +if [ -n "${HOOK3}" ]; then log "Running hook3: ${HOOK3}" ${HOOK3} result=$? -- cgit v1.2.3