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 |
---|
| 14 | REPONAME=ogAdmRepo |
---|
| 15 | REPOLOG=$BASEDIR/log/$REPONAME.log |
---|
[e8460d2] | 16 | MCASTLOGBASE=$BASEDIR/log/mcastlog |
---|
| 17 | MCASTLOG=$MCASTLOGBASE/ogAdmRepoMcast.`date +%Y%m%d-%H%M%S` |
---|
[aa91bf5] | 18 | |
---|
[e8460d2] | 19 | mkdir -p $MCASTLOGBASE |
---|
[8fc9552] | 20 | |
---|
| 21 | PARM1=$(echo $PARM | cut -f1 -d" ") |
---|
| 22 | PARM2=$(echo $PARM | cut -f2 -d" ") |
---|
| 23 | PARM3=$(echo $PARM | cut -f3 -d" ") |
---|
| 24 | PARM4=$(echo $PARM | cut -f4 -d" ") |
---|
| 25 | |
---|
| 26 | |
---|
| 27 | case $PARM1 in |
---|
| 28 | START_MULTICAST) |
---|
[aa91bf5] | 29 | #1 START_MULTICAST |
---|
| 30 | #2 fichero a enviar |
---|
| 31 | #3 opciones de multicast |
---|
| 32 | FILE=/opt/opengnsys/images$PARM2 |
---|
| 33 | MCASTOPT=$PARM3 |
---|
[e8460d2] | 34 | echo `date +%Y%m%d-%H%M%S` "/opt/opengnsys/bin/sendFileMcast $FILE $MCASTOPT" >> $REPOLOG |
---|
| 35 | /opt/opengnsys/bin/sendFileMcast $FILE $MCASTOPT &>> $MCASTLOG |
---|
| 36 | case $? in |
---|
| 37 | 1) |
---|
| 38 | echo `date +%Y%m%d-%H%M%S` Parametros insuficientes >> $REPOLOG |
---|
| 39 | ;; |
---|
| 40 | 2) |
---|
| 41 | echo `date +%Y%m%d-%H%M%S` Fichero no accesible >> $REPOLOG |
---|
| 42 | ;; |
---|
| 43 | 3) |
---|
| 44 | echo `date +%Y%m%d-%H%M%S` sesion multicast no valida >> $REPOLOG |
---|
| 45 | ;; |
---|
| 46 | esac |
---|
[35a3e22] | 47 | ;; |
---|
| 48 | default) |
---|
| 49 | echo "Solicitud con parametros: - $PARM - no realizada: No registrada o con errores" >> $REPOLOG |
---|
[8fc9552] | 50 | ;; |
---|
[aa91bf5] | 51 | esac |
---|
Note: See
TracBrowser
for help on using the repository browser.