summaryrefslogtreecommitdiffstats
path: root/client/shared
diff options
context:
space:
mode:
authorramon <ramongomez@us.es>2014-10-15 12:05:09 +0000
committerramon <ramongomez@us.es>2014-10-15 12:05:09 +0000
commit9a1df17f3d3d4d1c331e7333298563b443178df1 (patch)
tree1f954496f8469ac7cf55d15ae6a91322ab96dd8b /client/shared
parentd32ebd8f1d0858d76158698e193f9914aaf98f5c (diff)
#611 #640: Adaptar scripts a las funciones {{{ogEcho}}} y {{{ogExecAndLog}}} para que el código sea más legible.
git-svn-id: https://opengnsys.es/svn/branches/version1.0@4405 a21b9725-9963-47de-94b9-378ad31fedc9
Diffstat (limited to 'client/shared')
-rwxr-xr-xclient/shared/scripts/restoreBaseImage4
-rwxr-xr-xclient/shared/scripts/restoreDiffImage2
-rwxr-xr-xclient/shared/scripts/restoreImage2
-rwxr-xr-xclient/shared/scripts/updateCache12
4 files changed, 10 insertions, 10 deletions
diff --git a/client/shared/scripts/restoreBaseImage b/client/shared/scripts/restoreBaseImage
index e30134e0..e13c946a 100755
--- a/client/shared/scripts/restoreBaseImage
+++ b/client/shared/scripts/restoreBaseImage
@@ -132,14 +132,14 @@ ogUnmountImage "$1" "$2" "$IMGEXT"
# Restableciendo acl
ogUnlock $3 $4
ogEcho log session "[70] $MSG_HELP_ogRestoreInfoImage"
-ogRestoreInfoImage $3 $4 2>&1 | tee -a $OGLOGCOMMAND
+ogExecAndLog command ogRestoreInfoImage $3 $4
# Llamar al script de post-configuración del sistema operativo.
# Si a este script lo ha llamado el script restoreDiffImage no post-configuramos
if [ "$(ogGetCaller)" != "restoreDiffImage" ];then
if which configureOsCustom &>/dev/null; then
ogEcho log session "[90] configureOsCustom"
- # CDC: enviamos todos los parametros.
+ # Enviamos todos los parametros.
configureOsCustom "$1" "$2" "$3" "$4"
else
ogEcho log session "[90] $MSG_HELP_configureOs"
diff --git a/client/shared/scripts/restoreDiffImage b/client/shared/scripts/restoreDiffImage
index b854f5c0..40d8626c 100755
--- a/client/shared/scripts/restoreDiffImage
+++ b/client/shared/scripts/restoreDiffImage
@@ -121,7 +121,7 @@ ogEcho log session " $MSG_SCRIPTS_TASK_END, $MSG_SCRIPTS_TIME_PARTIAL : $[T
# creando enlaces y restableciendo ACL (en windows)
ogEcho log session "[70] $MSG_HELP_ogRestoreInfoImage"
-ogRestoreInfoImage "$4" "$5" 2>&1 | tee -a $OGLOGCOMMAND
+ogExecAndLog command ogRestoreInfoImage "$4" "$5"
# Llamar al script de post-configuración del sistema operativo.
if which configureOsCustom &>/dev/null; then
diff --git a/client/shared/scripts/restoreImage b/client/shared/scripts/restoreImage
index ae403494..4575bf6c 100755
--- a/client/shared/scripts/restoreImage
+++ b/client/shared/scripts/restoreImage
@@ -53,7 +53,7 @@ case "$PROTO" in
#TODO comprobar parametros anteriores
ogEcho log session "[40] ogMcastReceiverPartition $DISK $PART $PORT $TOOL $COMPRESS"
ogMcastRequest "$IMGNAME.img" "$PROTOOPT"
- ogMcastReceiverPartition "$DISK" "$PART" "$PORT" "$TOOL" "$COMPRESS" 2>&1 | tee -a $OGLOGCOMMAND
+ ogExecAndLog command ogMcastReceiverPartition "$DISK" "$PART" "$PORT" "$TOOL" "$COMPRESS"
RETVAL=${PIPESTATUS[0]}
;;
*) # Protocolo desconocido.
diff --git a/client/shared/scripts/updateCache b/client/shared/scripts/updateCache
index fe871809..8d501f50 100755
--- a/client/shared/scripts/updateCache
+++ b/client/shared/scripts/updateCache
@@ -173,7 +173,7 @@ case "$PROTOCOLO" in
ogEcho log session "ogCopyFile $1 $2.torrent absolute $OGCAC/$OGIMG"
# tiempos
timewait=$(expr $(printf '%d\n' 0x$(ogGetMacAddress | awk -F: '{print $5$6}')) \* 120 / 65535)
- ogCopyFile $REPOSITORIO "$2.torrent" "$IMGDIR" 2>&1 | tee -a $OGLOGCOMMAND
+ ogExecAndLog command ogCopyFile $REPOSITORIO "$2.torrent" "$IMGDIR"
#TODO: comprobar que el tracker definido en el fichero es correcto.
#TODO comprobar que el fichero torrent está en cache
# retardamos el inicio -aleatorio de 0 a 120 segundos- al tracker para gestionar mas de +-40 equipos
@@ -181,11 +181,11 @@ case "$PROTOCOLO" in
ogEcho log session " [ ] $MSG_SCRIPTS_TASK_SLEEP : $P2PWAIT seconds ogTorrentStart CACHE $2.torrent $4"
sleep $P2PWAIT
ogEcho log session " [ ] $MSG_SCRIPTS_TASK_START: ogTorrentStart CACHE $2.torrent $4"
- ogTorrentStart CACHE "$2.torrent" $4 2>&1 | tee -a $OGLOGCOMMAND
+ ogExecAndLog command ogTorrentStart CACHE "$2.torrent" $4
RESUMEUPDATECACHE=$(grep -m 1 -B1 "Download" $OGLOGCOMMAND)
RESUMEUPDATECACHEbf=$(grep -m 1 "Download" $OGLOGCOMMAND)
if [ "$RESUMEUPDATECACHEbf" == "Download complete." ]; then
- rm $IMGDIR$2".torrent.bf" 2>&1 | tee -a $OGLOGCOMMAND
+ rm -f $IMGDIR$2".torrent.bf"
fi
;;
MULTICAST)
@@ -198,7 +198,7 @@ case "$PROTOCOLO" in
#FIN TODO
if (nmap -n -sU -p $PORTAUX $REPOIP | grep open)
then
- ogMcastReceiverFile $PORT CACHE "$2" 2>&1 | tee -a $OGLOGCOMMAND
+ ogExecAndLog command ogMcastReceiverFile $PORT CACHE "$2"
else
# TODO ticket 379 Realizar la petición basada en identificador de operacion
@@ -208,7 +208,7 @@ case "$PROTOCOLO" in
sleep 10
if (nmap -n -sU -p $PORTAUX $REPOIP | grep open)
then
- ogMcastReceiverFile $PORT CACHE "$2" 2>&1 | tee -a $OGLOGCOMMAND
+ ogExecAndLog command ogMcastReceiverFile $PORT CACHE "$2"
else
ogEcho log session "$MSG_SCRIPTS_TASK_ERR : hose $REPOIP 2009 --out sh -c echo -ne START_MULTICAST $2 $OPTPROTOCOLO"
exit $OG_ERR_UPDATECACHE
@@ -221,7 +221,7 @@ case "$PROTOCOLO" in
;;
UNICAST)
#ogEcho log session "unicast"
- ogCopyFile $REPOSITORIO "$2" "$IMGDIR" 2>&1 | tee -a $OGLOGCOMMAND
+ ogExecAndLog command ogCopyFile $REPOSITORIO "$2" "$IMGDIR"
sleep 5
RESUMEUPDATECACHE=$(grep -m 1 "100%" $OGLOGCOMMAND.tmp)
;;