summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xadmin/Interface/Configurar12
-rw-r--r--admin/WebConsole/asistentes/jscripts/asistentes.js30
-rwxr-xr-xclient/shared/scripts/restoreBaseImage4
-rwxr-xr-xclient/shared/scripts/restoreDiffImage2
-rwxr-xr-xclient/shared/scripts/restoreImage2
-rwxr-xr-xclient/shared/scripts/updateCache12
6 files changed, 30 insertions, 32 deletions
diff --git a/admin/Interface/Configurar b/admin/Interface/Configurar
index a10143f3..661f4d57 100755
--- a/admin/Interface/Configurar
+++ b/admin/Interface/Configurar
@@ -112,21 +112,21 @@ ogUnmountAll $dis &>/dev/null
# Elimina la tabla de particiones
ogDeletePartitionTable $dis
-ogUpdatePartitionTable $dis | tee -a $OGLOGSESSION $OGLOGFILE
+ogExecAndLog session log ogUpdatePartitionTable $dis
# Crea tabla de particiones MSDOS (NOTA: adaptar para tablas GPT).
ogCreatePartitionTable $dis MSDOS
# Cuestión caché
if [ "$che" == "1" ]; then
- initCache $tch >/dev/null | tee -a $OGLOGSESSION $OGLOGFILE
+ ogExecAndLog session log initCache $tch
fi
# Definir particionado.
-ogCreatePartitions $dis ${TBP[@]} | tee -a $OGLOGSESSION $OGLOGFILE
-ogUpdatePartitionTable $dis | tee -a $OGLOGSESSION $OGLOGFILE
+ogExecAndLog session log ogCreatePartitions $dis ${TBP[@]}
+ogExecAndLog session log ogUpdatePartitionTable $dis
-RETVAL=$?
+RETVAL=$?
if [ $RETVAL -ne 0 ]; then
kill $COPROC_PID
exit $RETVAL
@@ -136,7 +136,7 @@ fi
for ((par=1; par<=$maxp; par++)); do
sfi="${TBF[par]}"
if [ "$sfi" != "EMPTY" ]; then
- ogFormatFs $dis $par $sfi | tee -a $OGLOGSESSION $OGLOGFILE
+ ogExecAndLog session log ogFormatFs $dis $par $sfi
RETVAL=$?
if [ $RETVAL -ne 0 ]; then
kill $COPROC_PID
diff --git a/admin/WebConsole/asistentes/jscripts/asistentes.js b/admin/WebConsole/asistentes/jscripts/asistentes.js
index d86176ca..947dc39e 100644
--- a/admin/WebConsole/asistentes/jscripts/asistentes.js
+++ b/admin/WebConsole/asistentes/jscripts/asistentes.js
@@ -21,10 +21,8 @@ switch (form.idmetodo.value)
//form.codigo.value="cloneRemoteFromMaster " + form.ipMaster.value + " 1 " + form.PartOrigen.value + " " + form.mcastpuerto.value + ":" + form.mcastmodo.value + ":" + form.mcastdireccion.value + ":" + form.mcastvelocidad.value + "M:" + form.mcastnclien.value + ":" + form.mcastseg.value + " 1 " + form.PartOrigen.value + " " + form.tool.value + " " + form.compresor.value;
command="cloneRemoteFromMaster " + form.ipMaster.value + " " + form.source.value + " " + protocol + " " + form.targetpart.value + " " + form.tool.value + " " + form.compresor.value;
form.codigo.value="\
-ogEcho log session \"[0] $MSG_SCRIPTS_TASK_START " + comand + "\"\n " +
-command + " | tee -a $OGLOGCOMMAND \n ";
-//cloneRemoteFromMaster " + form.ipMaster.value + " " + form.source.value + " " + protocol + " " + form.targetpart.value + " " + form.tool.value + " " + form.compresor.value + " | tee -a $OGLOGCOMMAND \n";
-//form.codigo.value="cloneRemoteFromMaster " + form.ipMaster.value + " " + form.source.value + " " + protocol + " " + form.targetpart.value + " " + form.tool.value + " " + form.compresor.value;
+ogEcho log session \"[0] $MSG_SCRIPTS_TASK_START " + comand + "\"\n \
+ogExecAndLog command " + command + " \n ";
}
function codeDeployImage(form){
@@ -142,9 +140,9 @@ ogEcho session \"[20] $MSG_HELP_ogGetCacheSize\"\n \
sizecache=`ogGetCacheSize` \n \
ogEcho session \"[30] $MSG_HELP_ogUpdatePartitionTable "+n_disk+"\"\n \
ogDeletePartitionTable "+n_disk+" \n \
-ogUpdatePartitionTable "+n_disk+" | tee -a $OGLOGCOMMAND \n \
+ogExecAndLog command ogUpdatePartitionTable "+n_disk+" \n \
ogEcho session \"[50] $MSG_HELP_ogCreateCache\"\n \
-initCache "+n_disk+" $sizecache &>/dev/null | tee -a $OGLOGCOMMAND \n ";
+initCache "+n_disk+" $sizecache &>/dev/null \n ";
} else {
if (form.size4.value == "CUSTOM") {
cacheSize = form.size4custom.value;
@@ -156,7 +154,7 @@ ogEcho session \"[30] $MSG_HELP_ogUpdatePartitionTable "+n_disk+"\"\n \
ogDeletePartitionTable "+n_disk+" \n \
ogUpdatePartitionTable "+n_disk+" \n \
ogEcho session \"[50] $MSG_HELP_ogCreateCache\"\n \
-initCache " + n_disk + " " + cacheSize + " &>/dev/null | tee -a $OGLOGCOMMAND";
+initCache " + n_disk + " " + cacheSize + " &>/dev/null";
}
} else {
cacheCode="\
@@ -207,15 +205,15 @@ ogUnmountCache \n \
ogUnmountAll "+n_disk+" 2>/dev/null\n \
" + cacheCode + " \n \
ogEcho session \"[60] $MSG_HELP_ogListPartitions "+n_disk+"\"\n \
-ogListPartitions "+n_disk+" | tee -a $OGLOGCOMMAND $OGLOGSESSION \n \
+ogExecAndLog command session ogListPartitions "+n_disk+" \n \
ogEcho session \"[70] $MSG_HELP_ogCreatePartitions " + partCode + "\"\n \
-ogCreatePartitions "+n_disk+" " + partCode + " | tee -a $OGLOGCOMMAND \n \
+ogExecAndLog command ogCreatePartitions "+n_disk+" " + partCode + " \n \
ogEcho session \"[80] $MSG_HELP_ogSetPartitionActive "+n_disk+" 1\"\n \
ogSetPartitionActive "+n_disk+" 1 \n \
ogEcho log session \"[100] $MSG_HELP_ogListPartitions "+n_disk+"\"\n \
ogUpdatePartitionTable "+n_disk+" \n \
ms-sys /dev/sda | grep unknow && ms-sys /dev/sda \n \
-ogListPartitions "+n_disk+" | tee -a $OGLOGCOMMAND $OGLOGSESSION $OGLOGFILE \n \
+ogExecAndLog command session log ogListPartitions "+n_disk+" \n \
reboot \n";
}
@@ -242,9 +240,9 @@ ogEcho session \"[20] $MSG_HELP_ogGetCacheSize\"\n \
sizecache=`ogGetCacheSize` \n \
ogEcho session \"[30] $MSG_HELP_ogUpdatePartitionTable "+n_disk+"\"\n \
ogDeletePartitionTable "+n_disk+" \n \
-ogUpdatePartitionTable "+n_disk+" | tee -a $OGLOGCOMMAND \n \
+ogExecAndLog command ogUpdatePartitionTable "+n_disk+" \n \
ogEcho session \"[50] $MSG_HELP_ogCreateCache\"\n \
-initCache "+ n_disk +" $sizecache &>/dev/null | tee -a $OGLOGCOMMAND \n ";
+initCache "+ n_disk +" $sizecache &>/dev/null \n ";
} else {
if (form.sizeGPT4.value == "CUSTOM") {
cacheSize = form.sizeGPT4custom.value;
@@ -256,7 +254,7 @@ ogEcho session \"[30] $MSG_HELP_ogUpdatePartitionTable "+n_disk+"\"\n \
ogDeletePartitionTable "+n_disk+" \n \
ogUpdatePartitionTable "+n_disk+" \n \
ogEcho session \"[50] $MSG_HELP_ogCreateCache\"\n \
-initCache " + n_disk +" "+ cacheSize + " &>/dev/null | tee -a $OGLOGCOMMAND";
+initCache " + n_disk +" "+ cacheSize + " &>/dev/null";
}
} else{
var partType=eval("form.partGPT"+nPart);
@@ -294,15 +292,15 @@ ogUnmountCache \n \
ogUnmountAll "+n_disk+" \n \
" + cacheCode + " \n \
ogEcho session \"[60] $MSG_HELP_ogListPartitions "+n_disk+"\"\n \
-ogListPartitions "+n_disk+" | tee -a $OGLOGCOMMAND $OGLOGSESSION \n \
+ogExecAndLog command session ogListPartitions "+n_disk+" \n \
ogEcho session \"[70] $MSG_HELP_ogCreatePartitions " + partCode + "\"\n \
-ogCreatePartitions "+n_disk+" " + partCode + " | tee -a $OGLOGCOMMAND \n \
+ogExecAndLog command ogCreatePartitions "+n_disk+" " + partCode + " \n \
ogEcho session \"[80] $MSG_HELP_ogSetPartitionActive "+n_disk+" 1\"\n \
ogSetPartitionActive "+n_disk+" 1 \n \
ogEcho log session \"[100] $MSG_HELP_ogListPartitions "+n_disk+"\"\n \
ogUpdatePartitionTable "+n_disk+" \n \
ms-sys /dev/sda | grep unknow && ms-sys /dev/sda \n \
-ogListPartitions "+n_disk+" | tee -a $OGLOGCOMMAND $OGLOGSESSION $OGLOGFILE \n \
+ogExecAndLog command session log ogListPartitions "+n_disk+" \n \
reboot \n";
}
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)
;;