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
Line | |
---|
1 | #!/bin/bash |
---|
2 | PARM=`cat` |
---|
3 | |
---|
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 | |
---|
13 | BASEDIR=/opt/opengnsys |
---|
14 | REPONAME=ogAdmRepo |
---|
15 | REPOLOG=$BASEDIR/log/$REPONAME.log |
---|
16 | MCASTLOGBASE=$BASEDIR/log/mcastlog |
---|
17 | MCASTLOG=$MCASTLOGBASE/ogAdmRepoMcast.`date +%Y%m%d-%H%M%S` |
---|
18 | |
---|
19 | mkdir -p $MCASTLOGBASE |
---|
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) |
---|
29 | #1 START_MULTICAST |
---|
30 | #2 fichero a enviar |
---|
31 | #3 opciones de multicast |
---|
32 | FILE=/opt/opengnsys/images$PARM2 |
---|
33 | MCASTOPT=$PARM3 |
---|
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 |
---|
47 | ;; |
---|
48 | default) |
---|
49 | echo "Solicitud con parametros: - $PARM - no realizada: No registrada o con errores" >> $REPOLOG |
---|
50 | ;; |
---|
51 | esac |
---|
Note: See
TracBrowser
for help on using the repository browser.