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
Rev | Line | |
---|
[bd7b0ec] | 1 | #!/bin/bash |
---|
| 2 | #@file upgrade-clients-udeb.sh |
---|
| 3 | #@brief Actualiza los paquetes udeb que deben ser exportados a los clientes. |
---|
| 4 | #@note El script debe ser copiado a \c opengnsys/bin y el fichero de configuración a \c opengnsys/etc |
---|
| 5 | #@note Formato del fichero \c udeb.list : {install|remove}:paquete |
---|
| 6 | |
---|
| 7 | |
---|
| 8 | # Variables |
---|
| 9 | PROG="$(basename $0)" |
---|
| 10 | OPENGNSYS=${OPENGNSYS:-"/opt/opengnsys"} |
---|
| 11 | CFGFILE="$OPENGNSYS/etc/udeblist.conf" |
---|
| 12 | OGUDEB="$OPENGNSYS/client/lib/udeb" |
---|
| 13 | TMPUDEB="/tmp/udeb" |
---|
| 14 | UDEBLIST="/etc/apt/sources.list.d/udeb.list" |
---|
| 15 | |
---|
| 16 | #/// Comprobar fichero de configuración. |
---|
| 17 | if [ ! -f "$CFGFILE" ]; then |
---|
| 18 | echo "$PROG: No existe el fichero de configuración \"$CFGFILE\"" >&2 |
---|
| 19 | exit 1 |
---|
| 20 | fi |
---|
| 21 | PACKAGES_INSTALL=$(awk -F: '$1~/install/ {print $2}' $CFGFILE) |
---|
| 22 | PACKAGES_REMOVE=$(awk -F: '$1~/remove/ {print $2}' $CFGFILE) |
---|
| 23 | if [ -z "$PACKAGES_INSTALL" ]; then |
---|
| 24 | echo "$PROG: No hay paquetes para descargar." >&2 |
---|
| 25 | exit 2 |
---|
| 26 | fi |
---|
| 27 | |
---|
| 28 | #/// Crear configuración para apt-get |
---|
| 29 | echo "deb http://es.archive.ubuntu.com/ubuntu/ jaunty main/debian-installer" >$UDEBLIST |
---|
| 30 | mkdir -p $TMPUDEB/partial |
---|
| 31 | rm -f $TMPUDEB/*.udeb |
---|
| 32 | |
---|
| 33 | #/// Descargar paquetes udeb, borrar los descartables y moverlos al NFS. |
---|
[50038e9] | 34 | apt-get update |
---|
[bd7b0ec] | 35 | apt-get install -y -o dir::cache::archives=$TMPUDEB -d $PACKAGES_INSTALL |
---|
| 36 | for i in $PACKAGES_REMOVE; do |
---|
| 37 | rm -f $TMPUDEB/${i}_*.udeb |
---|
| 38 | done |
---|
| 39 | rm -f $OGUDEB/*.udeb |
---|
| 40 | mv $TMPUDEB/*.udeb $OGUDEB |
---|
| 41 | rm -f $UDEBLIST |
---|
| 42 | |
---|
Note: See
TracBrowser
for help on using the repository browser.