configure-oglivelgromero-new-oglivemainmaint-cronmount-efivarfsmultivmmultivm-ogboot-installerogClonningEngineogboot-installer-jenkinsoglive-ipv6test-python-scriptsticket-301ticket-50ticket-50-oldticket-577ticket-585ticket-611ticket-612ticket-693ticket-700ubu24tplunification2use-local-agent-oglivevarios-instalacion
Last change
on this file since 9f4584f was
c28eefa,
checked in by Natalia Serrano <natalia.serrano@…>, 19 months ago
|
Log to syslog in a number of shell scripts
|
-
Property mode set to
100755
|
File size:
1004 bytes
|
Line | |
---|
1 | #!/bin/bash |
---|
2 | # Script para solicitar acciones al servidor de administración desde los clientes. |
---|
3 | # Acciones permitidas: configurar modo de arranque. |
---|
4 | PARM=`cat` |
---|
5 | |
---|
6 | |
---|
7 | |
---|
8 | BASEDIR=/opt/opengnsys |
---|
9 | PATH=$PATH:$BASEDIR/bin |
---|
10 | SERVERNAME=ogAdmServer |
---|
11 | SERVERLOG=$BASEDIR/log/$SERVERNAME.log |
---|
12 | |
---|
13 | |
---|
14 | # Añade registro de incidencias. |
---|
15 | function echolog () { |
---|
16 | logger --tag $0 --priority local0.info "$*" |
---|
17 | echo "$*" |
---|
18 | } |
---|
19 | |
---|
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 | SET_CLIENTMODE) |
---|
29 | #1 SET_CLIENTMODE |
---|
30 | #2 template |
---|
31 | #3 pc_name o group_pc |
---|
32 | #4 modo temporal o permanente |
---|
33 | |
---|
34 | TEMPLATE="$PARM2" |
---|
35 | PC="$PARM3" |
---|
36 | #incluyo parametro de MODO |
---|
37 | MODO="$PARM4" |
---|
38 | echolog "Ejecutar $(which setclientmode) $FILE $MCASTOPT" |
---|
39 | #incluyo parametro de MODO |
---|
40 | setclientmode $TEMPLATE $PC $MODO &>> $SERVERLOG |
---|
41 | exit $? |
---|
42 | ;; |
---|
43 | default) |
---|
44 | echolog "Solicitud con parametros \"$PARM\" no realizada, no registrada o con errores" |
---|
45 | ;; |
---|
46 | esac |
---|
47 | |
---|
Note: See
TracBrowser
for help on using the repository browser.