source: client/boot/upgrade-clients-udeb.sh @ bf54d36

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
Last change on this file since bf54d36 was 6354c7b, checked in by ramon <ramongomez@…>, 15 years ago

Instalador detecta correctamente dependencias no instaladas; mejora en rendimiento descarga de paquetes udeb.

git-svn-id: https://opengnsys.es/svn/trunk@925 a21b9725-9963-47de-94b9-378ad31fedc9

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