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

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 562547a was 28c96b3, checked in by ramon <ramongomez@…>, 15 years ago

Usando Ubuntu 10.04 LTS Lucid como distribución por defecto; soporte básico para Ubuntu 10.10 Maverick.
Close #242

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

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