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 | PATH=$PATH:$BASEDIR/bin |
---|
15 | REPONAME=ogAdmRepo |
---|
16 | REPOLOG=$BASEDIR/log/$REPONAME.log |
---|
17 | MCASTLOGBASE=$BASEDIR/log/mcastlog |
---|
18 | MCASTLOG=$MCASTLOGBASE/ogAdmRepoMcast.`date +%Y%m%d-%H%M%S` |
---|
19 | |
---|
20 | # Añade registro de incidencias. |
---|
21 | function echolog () { |
---|
22 | date +"%Y%m%d-%H%M%S $*" >> $REPOLOG |
---|
23 | } |
---|
24 | |
---|
25 | mkdir -p $MCASTLOGBASE |
---|
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 | |
---|
33 | case "$PARM1" in |
---|
34 | START_MULTICAST) |
---|
35 | #1 START_MULTICAST |
---|
36 | #2 fichero a enviar |
---|
37 | #3 opciones de multicast |
---|
38 | FILE="$PARM2" |
---|
39 | MCASTOPT="$PARM3" |
---|
40 | echolog "Ejecutar $(which sendFileMcast) $FILE $MCASTOPT" |
---|
41 | sendFileMcast $FILE $MCASTOPT &>> $MCASTLOG |
---|
42 | case $? in |
---|
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 ;; |
---|
49 | esac |
---|
50 | ;; |
---|
51 | default) |
---|
52 | echolog "Solicitud con parametros \"$PARM\" no realizada, no registrada o con errores" |
---|
53 | ;; |
---|
54 | esac |
---|
55 | |
---|
Note: See
TracBrowser
for help on using the repository browser.