summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xclient/shared/scripts/deployImage14
-rwxr-xr-xclient/shared/scripts/restoreImage8
-rwxr-xr-xclient/shared/scripts/updateCache16
3 files changed, 19 insertions, 19 deletions
diff --git a/client/shared/scripts/deployImage b/client/shared/scripts/deployImage
index ec108e1f..08134cc2 100755
--- a/client/shared/scripts/deployImage
+++ b/client/shared/scripts/deployImage
@@ -40,7 +40,7 @@
PROG="$(basename $0)"
if [ $# -lt 4 ]; then
- ogRaiseError $OG_ERR_FORMAT "$MSG_FORMAT: $PROG REPO imagen ndisco nparticion [ UNICAST|UNICAST-CACHE|MULTICAST|MULTICAST-CACHE|TORRENT [opciones protocolo] ]"
+ ogRaiseError session $OG_ERR_FORMAT "$MSG_FORMAT: $PROG REPO imagen ndisco nparticion [ UNICAST|UNICAST-CACHE|MULTICAST|MULTICAST-CACHE|TORRENT [opciones protocolo] ]"
exit $?
fi
@@ -68,9 +68,9 @@ echo " " > $OGLOGCOMMAND
ogEcho log session "[1] $MSG_SCRIPTS_START $0 $*"
# Si el origen(pariticion) esta bloqueada salir.
-ogIsLocked $DISK $PART && exit $(ogRaiseError $OG_ERR_LOCKED "$MSG_PARTITION, $DISK $PART"; echo $?)
+ogIsLocked $DISK $PART && exit $(ogRaiseError session $OG_ERR_LOCKED "$MSG_PARTITION, $DISK $PART"; echo $?)
-ogEcho log session "Desmontando $DISK $PART"
+ogEcho log session "$MSG_HELP_ogUnmount $DISK $PART"
ogUnmount $DISK $PART 2>/dev/null
# Valor por defecto para el repositorio.
@@ -78,7 +78,7 @@ ogUnmount $DISK $PART 2>/dev/null
[ "$REPO" == "$(ogGetIpAddress)" ] && REPO="CACHE"
#Informacioin previa de la imagen
-IMGOS=$(ogGetImageInfo `ogGetPath $REPO $IMGNAME.img`) || exit $(ogRaiseError $OG_ERR_NOTFOUND "$REPO $3"; echo $?)
+IMGOS=$(ogGetImageInfo `ogGetPath $REPO $IMGNAME.img`) || exit $(ogRaiseError session $OG_ERR_NOTFOUND "$REPO $2"; echo $?)
IMGSIZE=$(ls -s `ogGetPath $REPO $IMGNAME.img`| cut -f1 -d" ")
ogEcho log session "[1] REPO=$REPO IMG-FILE=$IMGNAME.img SIZE=$IMGSIZE (KB) METADATA=$IMGOS"
@@ -126,13 +126,13 @@ case "$REPO" in
esac
;;
*) # Error: protocolo desconocido.
- ogRaiseError $OG_ERR_FORMAT "$MSG_ERR_FORMAT, $PROTO"
+ ogRaiseError session $OG_ERR_FORMAT "$MSG_ERR_FORMAT, $PROTO"
exit $?
;;
esac
;;
*) # Error: repositorio desconocido.
- ogRaiseError $OG_ERR_FORMAT "$MSG_ERR_FORMAT, $REPO"
+ ogRaiseError session $OG_ERR_FORMAT "$MSG_ERR_FORMAT, $REPO"
exit $?
;;
esac
@@ -160,7 +160,7 @@ RESUMERESTOREIMAGE=$(grep -m 1 "Total Time:" $OGLOGCOMMAND)
ogEcho log session " [ ] $RESUMERESTOREIMAGE " | tee -a $OGLOGSESSION $OGLOGFILE
# Si la transferencia ha dado error me salgo.
if [ $RETVAL -ne 0 ] ; then
- ogRaiseError $OG_ERR_IMAGE "$REPO $IMGNAME" 2>&1
+ ogRaiseError session $OG_ERR_IMAGE "$REPO $IMGNAME" 2>&1
# Muestro registro de fin de ejecución si no viene de Ejecutar Script
[ "$(ogGetCaller)" == "EjecutarScript" ] || ogEcho log session "$MSG_INTERFACE_END $OG_ERR_IMAGE"
exit $OG_ERR_IMAGE
diff --git a/client/shared/scripts/restoreImage b/client/shared/scripts/restoreImage
index 9d7b4e6e..e10cfba7 100755
--- a/client/shared/scripts/restoreImage
+++ b/client/shared/scripts/restoreImage
@@ -5,7 +5,7 @@
TIME1=$SECONDS
PROG="$(basename $0)"
if [ $# -lt 4 ]; then
- ogRaiseError $OG_ERR_FORMAT "$MSG_FORMAT: $PROG REPO|CACHE imagen ndisco nparticion [ UNICAST|MULTICAST opciones protocolo]"
+ ogRaiseError session $OG_ERR_FORMAT "$MSG_FORMAT: $PROG REPO|CACHE imagen ndisco nparticion [ UNICAST|MULTICAST opciones protocolo]"
exit $?
fi
@@ -19,7 +19,7 @@ fi
echo " " > $OGLOGCOMMAND
[ "$(ogGetCaller)" == "deployImage" ] || echo -n "" > $OGLOGSESSION;
-echo "[1] $MSG_SCRIPTS_START $0 $*" | tee -a $OGLOGSESSION $OGLOGFILE
+ogEcho log session "[1] $MSG_SCRIPTS_START $0 $*" | tee -a $OGLOGSESSION $OGLOGFILE
# Procesar parámetros de entrada
REPO="${1^^}"
@@ -34,7 +34,7 @@ IMGTYPE="${IMGTYPE:-"img"}"
IMGFILE=$(ogGetPath "$REPO" "$IMGNAME.$IMGTYPE")
IMGDIR=$(ogGetParentPath "$REPO" "$IMGNAME")
if [ "$IMGFILE" == "" -o "$IMGDIR" == "" ]; then
- ogRaiseError $OG_ERR_NOTFOUND "$REPO, ${IMGNAME%/*}"
+ ogRaiseError session $OG_ERR_NOTFOUND "$REPO, ${IMGNAME%/*}"
exit $?
fi
@@ -57,7 +57,7 @@ case "$PROTO" in
RETVAL=${PIPESTATUS[0]}
;;
*) # Protocolo desconocido.
- ogRaiseError $OG_ERR_FORMAT "$MSG_FORMAT: $PROG REPO|CACHE imagen ndisco nparticion [ UNICAST|MULTICAST opciones ]"
+ ogRaiseError session $OG_ERR_FORMAT "$MSG_FORMAT: $PROG REPO|CACHE imagen ndisco nparticion [ UNICAST|MULTICAST opciones ]"
exit $?
esac
diff --git a/client/shared/scripts/updateCache b/client/shared/scripts/updateCache
index 11cee1da..a75ff1e3 100755
--- a/client/shared/scripts/updateCache
+++ b/client/shared/scripts/updateCache
@@ -29,7 +29,7 @@
PROG="$(basename $0)"
if [ $# -lt 3 ]; then
- ogRaiseError $OG_ERR_FORMAT "$MSG_FORMAT: $PROG str_REPO _str_Relative_Path_OGIMG_with_/ PROTOCOLO OPCIONES_PROTOCOLO OPCIONES_UPDATECACHE"
+ ogRaiseError session $OG_ERR_FORMAT "$MSG_FORMAT: $PROG str_REPO _str_Relative_Path_OGIMG_with_/ PROTOCOLO OPCIONES_PROTOCOLO OPCIONES_UPDATECACHE"
exit $?
fi
@@ -45,16 +45,16 @@ REPOSITORIO="${1^^}"
PROTOCOLO="${3^^}"
OPTPROTOCOLO="$4"
REPOIP=$(ogGetRepoIp)
-echo $REPOSITORIO $REPOIP $PROTOCOLO $OPTPROTOCOLO
+ogEcho log session $REPOSITORIO $REPOIP $PROTOCOLO $OPTPROTOCOLO
# Si el repositorio local CACHE no existe error 15.
if ! $(ogFindCache >/dev/null); then
- ogRaiseError $OG_ERR_NOTCACHE "CACHE"
+ ogRaiseError session $OG_ERR_NOTCACHE "CACHE"
exit $0
fi
# comprobar si la imagen existe (.img, .img.diff o directorio)
-REPOFILE=$(ogGetPath "REPO" "/$2") || exit $(ogRaiseError $OG_ERR_NOTFOUND "REPO /$2"; echo $?)
+REPOFILE=$(ogGetPath "REPO" "/$2") || exit $(ogRaiseError session $OG_ERR_NOTFOUND "REPO /$2"; echo $?)
ogEcho log session "$MSG_SCRIPTS_UPDATECACHE_DOUPDATE"
# Distingo si es monolitica o sincronizable
@@ -70,7 +70,7 @@ if [ $? == 0 ]; then
RETVAL=0
else
# Si la imagen es monolitica y ha elegido protocolo = RSYNC salimos con error.
- [ $PROTOCOLO == "RSYNC" ] && exit $(ogRaiseError $OG_ERR_DONTSYNC_IMAGE "REPO $2"; echo $?)
+ [ $PROTOCOLO == "RSYNC" ] && exit $(ogRaiseError session $OG_ERR_DONTSYNC_IMAGE "REPO $2"; echo $?)
IMGSYNC=FALSE
#TODO: ogUpdateCacheIsNecesary debe borrar la imagen que tenga igual nombre pero distinto sum-
ogUpdateCacheIsNecesary $1 $2
@@ -80,7 +80,7 @@ fi
[ "$RETVAL" == "1" ] && exit 0
[ "$RETVAL" -gt "1" ] && exit 1
-echo "$MSG_SCRIPTS_UPDATECACHE_CHECKSIZECACHE" | tee -a $OGLOGSESSION $OGLOGFILE
+ogEcho log session "$MSG_SCRIPTS_UPDATECACHE_CHECKSIZECACHE"
CACHESIZE=$(ogGetCacheSize)
CACHESIZEFREE=$(ogGetFreeSize `ogFindCache`)
FILESIZE=$(ls -sk $(ogGetPath $REPOSITORIO "$2") | cut -f1 -d" ")
@@ -116,7 +116,7 @@ fi
if [ "$SIZEREQUIRED" -ge "$CACHESIZE" ]
then
ogEcho log session "$MSG_WARNING: $MSG_ERR_CACHESIZE: $2 = $SIZEREQUIRED > CACHE = $CACHESIZE"
- ogRaiseError $OG_ERR_CACHESIZE "CACHE"
+ ogRaiseError session $OG_ERR_CACHESIZE "CACHE"
exit $?
fi
@@ -143,7 +143,7 @@ then
;;
*)
ogEcho log session "$MSG_WARNING: $MSG_ERR_CACHESIZE: $2 = $FILESIZE > CACHE = $CACHESIZEFREE"
- ogRaiseError $OG_ERR_CACHESIZE "CACHE"
+ ogRaiseError session $OG_ERR_CACHESIZE "CACHE"
exit $?
;;
esac