configure-oglivelgromero-new-oglivemainmount-efivarfsmultivmmultivm-ogboot-installerogClonningEngineoglive-ipv6test-python-scriptsticket-577ticket-585ticket-611ticket-612ticket-693ticket-700ubu24tplunification2use-local-agent-oglivevarios-instalacion
Line | |
---|
1 | #!/bin/bash |
---|
2 | # Scirpt de ejemplo para almacenear en fichero temporal el listado de software. |
---|
3 | # Nota: se usa como base para el programa de recogida de listado de software de OpenGnsys Admin. |
---|
4 | # Formato: listSoftwareInfo [-r] ndisk npart |
---|
5 | # -r listado reducido (sin parches de Windows) |
---|
6 | |
---|
7 | PROG=$(basename "$0") |
---|
8 | REDUCED="no" |
---|
9 | if [ "$1" = "-r" ]; then |
---|
10 | REDUCED="yes" |
---|
11 | shift |
---|
12 | fi |
---|
13 | if [ $# -ne 2 ]; then |
---|
14 | ogRaiseError $OG_ERR_FORMAT "$MSG_FORMAT: $PROG ndisco nparticion" |
---|
15 | exit $? |
---|
16 | fi |
---|
17 | |
---|
18 | # Directorio del servidor donde se exportan los ficheros de registro. |
---|
19 | SERVERLOGDIR=$(mount | awk -v d=$OGLOG ' |
---|
20 | BEGIN {FS="[: ]"} |
---|
21 | {if ($4==d) dir=$2} |
---|
22 | END {print dir}') |
---|
23 | |
---|
24 | # Fichero de listado: soft-IP-ndisco-npart |
---|
25 | SOFTFILE="soft-$(ogGetIpAddress)-$1-$2" |
---|
26 | # Redirigir salida al fichero de listado. |
---|
27 | if [ "$REDUCED" = "no" ]; then |
---|
28 | ogListSoftware "$1" "$2" >$OGLOG/$SOFTFILE || exit $? |
---|
29 | else |
---|
30 | ogListSoftware "$1" "$2" | egrep -v "\(KB[0-9]{6}\)" >$OGLOG/$SOFTFILE || exit $? |
---|
31 | fi |
---|
32 | # Salid: camino del fichero de listado en el servidor de repositorio. |
---|
33 | #echo $SERVERLOGDIR/$SOFTFILE |
---|
34 | echo $OGLOG/$SOFTFILE |
---|
35 | |
---|
Note: See
TracBrowser
for help on using the repository browser.