summaryrefslogtreecommitdiffstats
path: root/admin/Sources/Services/ogAdmRepoAux
diff options
context:
space:
mode:
authorramon <ramongomez@us.es>2011-12-22 13:38:11 +0000
committerramon <ramongomez@us.es>2011-12-22 13:38:11 +0000
commitc3c7cb3ae6f6600223111a572050f34f2df6fa71 (patch)
tree96fce1db6bf64fee2845d3a48abcbe07d9937562 /admin/Sources/Services/ogAdmRepoAux
parent4caea352de0d0a19d4e0a2e2dd04980dd28e6be0 (diff)
Congelar versión 1.0.2 en tags/opengnsys-1.0.2 (modifica #446).opengnsys-1.0.2
git-svn-id: https://opengnsys.es/svn/tags/opengnsys-1.0.2@2405 a21b9725-9963-47de-94b9-378ad31fedc9
Diffstat (limited to 'admin/Sources/Services/ogAdmRepoAux')
-rwxr-xr-xadmin/Sources/Services/ogAdmRepoAux36
1 files changed, 20 insertions, 16 deletions
diff --git a/admin/Sources/Services/ogAdmRepoAux b/admin/Sources/Services/ogAdmRepoAux
index 9dd4b0bb..21c0e4f1 100755
--- a/admin/Sources/Services/ogAdmRepoAux
+++ b/admin/Sources/Services/ogAdmRepoAux
@@ -11,11 +11,17 @@ PARM=`cat`
BASEDIR=/opt/opengnsys
+PATH=$PATH:$BASEDIR/bin
REPONAME=ogAdmRepo
REPOLOG=$BASEDIR/log/$REPONAME.log
MCASTLOGBASE=$BASEDIR/log/mcastlog
MCASTLOG=$MCASTLOGBASE/ogAdmRepoMcast.`date +%Y%m%d-%H%M%S`
+# Añade registro de incidencias.
+function echolog () {
+ date +"%Y%m%d-%H%M%S $*" >> $REPOLOG
+}
+
mkdir -p $MCASTLOGBASE
PARM1=$(echo $PARM | cut -f1 -d" ")
@@ -24,28 +30,26 @@ PARM3=$(echo $PARM | cut -f3 -d" ")
PARM4=$(echo $PARM | cut -f4 -d" ")
-case $PARM1 in
+case "$PARM1" in
START_MULTICAST)
#1 START_MULTICAST
#2 fichero a enviar
#3 opciones de multicast
- FILE=/opt/opengnsys/images$PARM2
- MCASTOPT=$PARM3
- echo `date +%Y%m%d-%H%M%S` "/opt/opengnsys/bin/sendFileMcast $FILE $MCASTOPT" >> $REPOLOG
- /opt/opengnsys/bin/sendFileMcast $FILE $MCASTOPT &>> $MCASTLOG
+ FILE="$PARM2"
+ MCASTOPT="$PARM3"
+ echolog "Ejecutar $(which sendFileMcast) $FILE $MCASTOPT"
+ sendFileMcast $FILE $MCASTOPT &>> $MCASTLOG
case $? in
- 1)
- echo `date +%Y%m%d-%H%M%S` Parametros insuficientes >> $REPOLOG
- ;;
- 2)
- echo `date +%Y%m%d-%H%M%S` Fichero no accesible >> $REPOLOG
- ;;
- 3)
- echo `date +%Y%m%d-%H%M%S` sesion multicast no valida >> $REPOLOG
- ;;
+ 1) echolog "Parametros insuficientes"
+ return 1 ;;
+ 2) echolog "Fichero no accesible"
+ return 2 ;;
+ 3) echolog "Sesion multicast no valida"
+ return 3 ;;
esac
;;
default)
- echo "Solicitud con parametros: - $PARM - no realizada: No registrada o con errores" >> $REPOLOG
+ echolog "Solicitud con parametros \"$PARM\" no realizada, no registrada o con errores"
;;
-esac \ No newline at end of file
+esac
+