918-git-images-111dconfigfileconfigure-oglivegit-imageslgromero-new-oglivemainmaint-cronmount-efivarfsmultivmmultivm-ogboot-installerogClonningEngineogboot-installer-jenkinsoglive-ipv6test-python-scriptsticket-301ticket-50ticket-50-oldticket-577ticket-585ticket-611ticket-612ticket-693ticket-700ubu24tplunification2use-local-agent-oglivevarios-instalacionwebconsole3
Rev | Line | |
---|
[8fc9552] | 1 | #!/bin/bash |
---|
| 2 | PARM=`cat` |
---|
| 3 | |
---|
[e8460d2] | 4 | #TODO: ticket 379 |
---|
| 5 | #buscar parametro de identificador de operacion. |
---|
| 6 | #usar parametro de identificacion para anexarlo al nombre de log |
---|
| 7 | #Comprobar si la variable está seteas. |
---|
| 8 | #Si no lo está setearla. |
---|
| 9 | #Si esta seteada (en progreso) salir. |
---|
| 10 | |
---|
| 11 | |
---|
| 12 | |
---|
[aa91bf5] | 13 | BASEDIR=/opt/opengnsys |
---|
[7f7068e] | 14 | PATH=$PATH:$BASEDIR/bin |
---|
[aa91bf5] | 15 | REPONAME=ogAdmRepo |
---|
| 16 | REPOLOG=$BASEDIR/log/$REPONAME.log |
---|
[e8460d2] | 17 | MCASTLOGBASE=$BASEDIR/log/mcastlog |
---|
| 18 | MCASTLOG=$MCASTLOGBASE/ogAdmRepoMcast.`date +%Y%m%d-%H%M%S` |
---|
[aa91bf5] | 19 | |
---|
[7f7068e] | 20 | # Añade registro de incidencias. |
---|
| 21 | function echolog () { |
---|
| 22 | date +"%Y%m%d-%H%M%S $*" >> $REPOLOG |
---|
| 23 | } |
---|
| 24 | |
---|
[e8460d2] | 25 | mkdir -p $MCASTLOGBASE |
---|
[8fc9552] | 26 | |
---|
| 27 | PARM1=$(echo $PARM | cut -f1 -d" ") |
---|
| 28 | PARM2=$(echo $PARM | cut -f2 -d" ") |
---|
| 29 | PARM3=$(echo $PARM | cut -f3 -d" ") |
---|
| 30 | PARM4=$(echo $PARM | cut -f4 -d" ") |
---|
| 31 | |
---|
| 32 | |
---|
[7f7068e] | 33 | case "$PARM1" in |
---|
[8fc9552] | 34 | START_MULTICAST) |
---|
[aa91bf5] | 35 | #1 START_MULTICAST |
---|
| 36 | #2 fichero a enviar |
---|
| 37 | #3 opciones de multicast |
---|
[7f7068e] | 38 | FILE="$PARM2" |
---|
| 39 | MCASTOPT="$PARM3" |
---|
| 40 | echolog "Ejecutar $(which sendFileMcast) $FILE $MCASTOPT" |
---|
| 41 | sendFileMcast $FILE $MCASTOPT &>> $MCASTLOG |
---|
[e8460d2] | 42 | case $? in |
---|
[7f7068e] | 43 | 1) echolog "Parametros insuficientes" |
---|
| 44 | return 1 ;; |
---|
| 45 | 2) echolog "Fichero no accesible" |
---|
| 46 | return 2 ;; |
---|
| 47 | 3) echolog "Sesion multicast no valida" |
---|
| 48 | return 3 ;; |
---|
[e8460d2] | 49 | esac |
---|
[35a3e22] | 50 | ;; |
---|
| 51 | default) |
---|
[7f7068e] | 52 | echolog "Solicitud con parametros \"$PARM\" no realizada, no registrada o con errores" |
---|
[8fc9552] | 53 | ;; |
---|
[7f7068e] | 54 | esac |
---|
| 55 | |
---|
Note: See
TracBrowser
for help on using the repository browser.