Rev | Line | |
---|
[a2a8296] | 1 | #!/bin/bash |
---|
[ea7186c] | 2 | # Scirpt de ejemplo para almacenear en fichero temporal el listado de software. |
---|
[5b825b50] | 3 | # Nota: se usa como base para el programa de recogida de listado de software de OpenGnsys Admin. |
---|
[d10549b] | 4 | # Formato: listSoftwareInfo [-r] ndisk npart |
---|
[5b825b50] | 5 | # -r listado reducido (sin parches de Windows) |
---|
[ea7186c] | 6 | |
---|
[5b825b50] | 7 | PROG=$(basename "$0") |
---|
[d10549b] | 8 | REDUCED="no" |
---|
[5b825b50] | 9 | if [ "$1" = "-r" ]; then |
---|
| 10 | REDUCED="yes" |
---|
| 11 | shift |
---|
| 12 | fi |
---|
[ea7186c] | 13 | if [ $# -ne 2 ]; then |
---|
| 14 | ogRaiseError $OG_ERR_FORMAT "$MSG_FORMAT: $PROG ndisco nparticion" |
---|
| 15 | exit $? |
---|
| 16 | fi |
---|
| 17 | |
---|
[26c8bfd] | 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}') |
---|
[5b825b50] | 23 | |
---|
[26c8bfd] | 24 | # Fichero de listado: soft-IP-ndisco-npart |
---|
| 25 | SOFTFILE="soft-$(ogGetIpAddress)-$1-$2" |
---|
[ea7186c] | 26 | # Redirigir salida al fichero de listado. |
---|
[d10549b] | 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 |
---|
[26c8bfd] | 32 | # Salid: camino del fichero de listado en el servidor de repositorio. |
---|
[f2b3250] | 33 | #echo $SERVERLOGDIR/$SOFTFILE |
---|
| 34 | echo $OGLOG/$SOFTFILE |
---|
[6654a24] | 35 | |
---|
Note: See
TracBrowser
for help on using the repository browser.