summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorramon <ramongomez@us.es>2014-10-10 08:25:07 +0000
committerramon <ramongomez@us.es>2014-10-10 08:25:07 +0000
commitd32ebd8f1d0858d76158698e193f9914aaf98f5c (patch)
tree24d47298991e99cfeb25c2d011128b3335da3319
parent0646da6a8e2a1e52721a47c6f6d6a527eb0de486 (diff)
#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}}}.
git-svn-id: https://opengnsys.es/svn/branches/version1.0@4404 a21b9725-9963-47de-94b9-378ad31fedc9
-rwxr-xr-xclient/engine/System.lib8
-rwxr-xr-xclient/shared/scripts/restoreImage4
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":")