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