From d32ebd8f1d0858d76158698e193f9914aaf98f5c Mon Sep 17 00:00:00 2001 From: ramon Date: Fri, 10 Oct 2014 08:25:07 +0000 Subject: #611: corregir errata al componer la redirección de salida del comando a ejecutar y prueba de la nueva función en el script {{{restoreImage}}}. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://opengnsys.es/svn/branches/version1.0@4404 a21b9725-9963-47de-94b9-378ad31fedc9 --- client/engine/System.lib | 8 ++++++-- client/shared/scripts/restoreImage | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/client/engine/System.lib b/client/engine/System.lib index d19726cb..70a1b066 100755 --- a/client/engine/System.lib +++ b/client/engine/System.lib @@ -97,12 +97,16 @@ done [ -n "$COMMAND" ] || ogRaiseError $OG_ERR_FORMAT || return $? # Componer lista de ficheros de registro. -[ $ISCOMMAND ] && (FILES="$OGLOGCOMMAND"; > $FILES; REDIREC="2&>1") +if [ $ISCOMMAND ]; then + FILES="$OGLOGCOMMAND" + > $FILES + REDIREC="2>&1" +fi [ $ISLOG ] && FILES="$FILES $OGLOGFILE" [ $ISSESSION ] && FILES="$FILES $OGLOGSESSION" # Ejecutar comando. -$COMMAND $REDIREC | tee -a $FILES +eval $COMMAND $REDIREC | tee -a $FILES } diff --git a/client/shared/scripts/restoreImage b/client/shared/scripts/restoreImage index b701b82a..ae403494 100755 --- a/client/shared/scripts/restoreImage +++ b/client/shared/scripts/restoreImage @@ -43,8 +43,8 @@ case "$PROTO" in UNICAST|UNICAST-DIRECT) # Restaurar la imagen. ogEcho log session "[40] ogRestoreImage $REPO $IMGNAME $DISK $PART UNICAST" - ogRestoreImage "$REPO" "$IMGNAME" "$DISK" "$PART" 2>&1 | tee -a $OGLOGCOMMAND - RETVAL=${PIPESTATUS[0]} + ogExecAndLog command ogRestoreImage "$REPO" "$IMGNAME" "$DISK" "$PART" + RETVAL=$? ;; MULTICAST|MULTICAST-DIRECT) PORT=$(echo $PROTOOPT | cut -f1 -d":") -- cgit v1.2.3-18-g5258