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

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 cb57eeb was 50038e9, checked in by ramon <ramongomez@…>, 16 years ago

Pequeñas correcciones en instalador.

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

  • Property mode set to 100755
File size: 1.3 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#@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
9PROG="$(basename $0)"
10OPENGNSYS=${OPENGNSYS:-"/opt/opengnsys"}
11CFGFILE="$OPENGNSYS/etc/udeblist.conf"
12OGUDEB="$OPENGNSYS/client/lib/udeb"
13TMPUDEB="/tmp/udeb"
14UDEBLIST="/etc/apt/sources.list.d/udeb.list"
15
16#/// Comprobar fichero de configuración.
17if [ ! -f "$CFGFILE" ]; then
18    echo "$PROG: No existe el fichero de configuración \"$CFGFILE\"" >&2
19    exit 1
20fi
21PACKAGES_INSTALL=$(awk -F: '$1~/install/ {print $2}' $CFGFILE)
22PACKAGES_REMOVE=$(awk -F: '$1~/remove/ {print $2}' $CFGFILE)
23if [ -z "$PACKAGES_INSTALL" ]; then
24    echo "$PROG: No hay paquetes para descargar." >&2
25    exit 2
26fi
27
28#/// Crear configuración para apt-get
29echo "deb http://es.archive.ubuntu.com/ubuntu/ jaunty main/debian-installer" >$UDEBLIST
30mkdir -p $TMPUDEB/partial
31rm -f $TMPUDEB/*.udeb
32
33#/// Descargar paquetes udeb, borrar los descartables y moverlos al NFS.
34apt-get update
35apt-get install -y -o dir::cache::archives=$TMPUDEB -d $PACKAGES_INSTALL
36for i in $PACKAGES_REMOVE; do
37    rm -f $TMPUDEB/${i}_*.udeb
38done
39rm -f $OGUDEB/*.udeb
40mv $TMPUDEB/*.udeb $OGUDEB
41rm -f $UDEBLIST
42
Note: See TracBrowser for help on using the repository browser.