summaryrefslogtreecommitdiffstats
path: root/admin/Sources
diff options
context:
space:
mode:
authorramon <ramongomez@us.es>2011-10-10 16:03:28 +0000
committerramon <ramongomez@us.es>2011-10-10 16:03:28 +0000
commit7f7068ef4cce890c44ab9c8a8308156a7bf11f29 (patch)
tree944ad7cbdb2605ec9362f29b70c5eb8caf336cf2 /admin/Sources
parent01a9904e7b81eacae8c9012c4d0a09999bc2e1f9 (diff)
Versión 1.0.2: simplificar servicio {{{ogAdmRepoAux}}}.
git-svn-id: https://opengnsys.es/svn/branches/version1.0@2338 a21b9725-9963-47de-94b9-378ad31fedc9
Diffstat (limited to 'admin/Sources')
-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
+