source: installer/opengnsys_update.sh @ e9d8b33

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 e9d8b33 was e9722d2, checked in by adv <adv@…>, 14 years ago

version1.0 #368 instalador y actualizador usando cliente 1.0.1

git-svn-id: https://opengnsys.es/svn/branches/version1.0@1855 a21b9725-9963-47de-94b9-378ad31fedc9

  • Property mode set to 100755
File size: 18.9 KB
Line 
1#!/bin/bash
2#/**
3#@file    opengnsys_update.sh
4#@brief   Script actualización de OpenGnSys
5#@warning No se actualiza BD, ni ficheros de configuración.
6#@version 0.9 - basado en opengnsys_installer.sh
7#@author  Ramón Gómez - ETSII Univ. Sevilla
8#@date    2010/01/27
9#@version 1.0 - adaptación a OpenGnSys 1.0
10#@author  Ramón Gómez - ETSII Univ. Sevilla
11#@date    2011/03/02
12#*/
13
14
15####  AVISO: Editar configuración de acceso por defecto a la Base de Datos.
16OPENGNSYS_DATABASE="ogAdmBD"            # Nombre de la base datos
17OPENGNSYS_DBUSER="usuog"                # Usuario de acceso
18OPENGNSYS_DBPASSWORD="passusuog"        # Clave del usuario
19
20####  AVISO: NO Editar variables de acceso desde el cliente
21OPENGNSYS_CLIENTUSER="opengnsys"        # Usuario Samba
22
23
24# Sólo ejecutable por usuario root
25if [ "$(whoami)" != 'root' ]
26then
27        echo "ERROR: this program must run under root privileges!!"
28        exit 1
29fi
30
31# Comprobar si se ha descargado el paquete comprimido (USESVN=0) o sólo el instalador (USESVN=1).
32PROGRAMDIR=$(readlink -e $(dirname "$0"))
33DEPS="build-essential g++-multilib rsync ctorrent samba unzip netpipes debootstrap schroot squashfs-tools"
34OPENGNSYS_SERVER="www.opengnsys.es"
35if [ -d "$PROGRAMDIR/../installer" ]; then
36    USESVN=0
37else
38    USESVN=1
39    SVN_URL=http://$OPENGNSYS_SERVER/svn/branches/version1.0
40    DEPS="$DEPS subversion"
41fi
42
43WORKDIR=/tmp/opengnsys_update
44mkdir -p $WORKDIR
45
46INSTALL_TARGET=/opt/opengnsys
47LOG_FILE=/tmp/opengnsys_update.log
48
49
50
51#####################################################################
52####### Algunas funciones útiles de propósito general:
53#####################################################################
54
55function getDateTime()
56{
57        date "+%Y%m%d-%H%M%S"
58}
59
60# Escribe a fichero y muestra por pantalla
61function echoAndLog()
62{
63        echo $1
64        FECHAHORA=`getDateTime`
65        echo "$FECHAHORA;$SSH_CLIENT;$1" >> $LOG_FILE
66}
67
68function errorAndLog()
69{
70        echo "ERROR: $1"
71        FECHAHORA=`getDateTime`
72        echo "$FECHAHORA;$SSH_CLIENT;ERROR: $1" >> $LOG_FILE
73}
74
75
76#####################################################################
77####### Funciones de copia de seguridad y restauración de ficheros
78#####################################################################
79
80# Hace un backup del fichero pasado por parámetro
81# deja un -last y uno para el día
82function backupFile()
83{
84        if [ $# -ne 1 ]; then
85                errorAndLog "${FUNCNAME}(): invalid number of parameters"
86                exit 1
87        fi
88
89        local fichero=$1
90        local fecha=`date +%Y%m%d`
91
92        if [ ! -f $fichero ]; then
93                errorAndLog "${FUNCNAME}(): file $fichero doesn't exists"
94                return 1
95        fi
96
97        echoAndLog "${FUNCNAME}(): Making $fichero back-up"
98
99        # realiza una copia de la última configuración como last
100        cp -p $fichero "${fichero}-LAST"
101
102        # si para el día no hay backup lo hace, sino no
103        if [ ! -f "${fichero}-${fecha}" ]; then
104                cp -p $fichero "${fichero}-${fecha}"
105        fi
106}
107
108# Restaura un fichero desde su copia de seguridad
109function restoreFile()
110{
111        if [ $# -ne 1 ]; then
112                errorAndLog "${FUNCNAME}(): invalid number of parameters"
113                exit 1
114        fi
115
116        local fichero=$1
117
118        echoAndLog "${FUNCNAME}(): restoring file $fichero"
119        if [ -f "${fichero}-LAST" ]; then
120                cp -p "$fichero-LAST" "$fichero"
121        fi
122}
123
124
125#####################################################################
126####### Funciones de acceso a base de datos
127#####################################################################
128
129# Actualizar la base datos
130function importSqlFile()
131{
132        if [ $# -ne 4 ]; then
133                errorAndLog "${FNCNAME}(): invalid number of parameters"
134                exit 1
135        fi
136
137        local dbuser="$1"
138        local dbpassword="$2"
139        local database="$3"
140        local sqlfile="$4"
141        local tmpfile=$(mktemp)
142        local status
143
144        if [ ! -r $sqlfile ]; then
145                errorAndLog "${FUNCNAME}(): Unable to read $sqlfile!!"
146                return 1
147        fi
148
149        echoAndLog "${FUNCNAME}(): importing SQL file to ${database}..."
150        chmod 600 $tmpfile
151        sed -e "s/SERVERIP/$SERVERIP/g" -e "s/DBUSER/$OPENGNSYS_DB_USER/g" \
152            -e "s/DBPASSWORD/$OPENGNSYS_DB_PASSWD/g" $sqlfile > $tmpfile
153        mysql -u$dbuser -p"$dbpassword" --default-character-set=utf8 "$database" < $tmpfile
154        status=$?
155        rm -f $tmpfile
156        if [ $status -ne 0 ]; then
157                errorAndLog "${FUNCNAME}(): error importing $sqlfile in database $database"
158                return 1
159        fi
160        echoAndLog "${FUNCNAME}(): file imported to database $database"
161        return 0
162}
163
164
165#####################################################################
166####### Funciones de instalación de paquetes
167#####################################################################
168
169# Instalar las deependencias necesarias para el actualizador.
170function installDependencies ()
171{
172        if [ $# = 0 ]; then
173                echoAndLog "${FUNCNAME}(): no deps needed."
174        else
175                while [ $# -gt 0 ]; do
176                        dpkg -s $1 2>/dev/null | grep -q "Status: install ok"
177                        if [ $? -ne 0 ]; then
178                                INSTALLDEPS="$INSTALLDEPS $1"
179                        fi
180                        shift
181                done
182                if [ -n "$INSTALLDEPS" ]; then
183                        apt-get update && apt-get -y install --force-yes $INSTALLDEPS
184                        if [ $? -ne 0 ]; then
185                                errorAndLog "${FUNCNAME}(): cannot install some dependencies: $INSTALLDEPS."
186                                return 1
187                        fi
188                fi
189        fi
190}
191
192
193#####################################################################
194####### Funciones para el manejo de Subversion
195#####################################################################
196
197function svnExportCode()
198{
199        if [ $# -ne 1 ]; then
200                errorAndLog "${FUNCNAME}(): invalid number of parameters"
201                exit 1
202        fi
203
204        local url=$1
205
206        echoAndLog "${FUNCNAME}(): downloading subversion code..."
207
208        svn checkout "${url}" opengnsys
209        if [ $? -ne 0 ]; then
210                errorAndLog "${FUNCNAME}(): error getting code from ${url}, verify your user and password"
211                return 1
212        fi
213        echoAndLog "${FUNCNAME}(): subversion code downloaded"
214        return 0
215}
216
217
218############################################################
219###  Detectar red
220############################################################
221
222# Comprobar si existe conexión.
223function checkNetworkConnection()
224{
225        OPENGNSYS_SERVER=${OPENGNSYS_SERVER:-"www.opengnsys.es"}
226        wget --spider -q $OPENGNSYS_SERVER
227}
228
229# Obtener los parámetros de red de la interfaz por defecto.
230function getNetworkSettings()
231{
232        local MAINDEV
233
234        echoAndLog "$FUNCNAME(): Detecting default network parameters."
235        MAINDEV=$(ip -o link show up | awk '!/loopback/ {d=d$2} END {sub(/:.*/,"",d); print d}')
236        if [ -z "$MAINDEV" ]; then
237                errorAndLog "${FUNCNAME}(): Network device not detected."
238                return 1
239        fi
240
241        # Variables de ejecución de Apache
242        # - APACHE_RUN_USER
243        # - APACHE_RUN_GROUP
244        if [ -f /etc/apache2/envvars ]; then
245                source /etc/apache2/envvars
246        fi
247        APACHE_RUN_USER=${APACHE_RUN_USER:-"www-data"}
248        APACHE_RUN_GROUP=${APACHE_RUN_GROUP:-"www-data"}
249}
250
251
252#####################################################################
253####### Funciones específicas de la instalación de Opengnsys
254#####################################################################
255
256# Copiar ficheros de arranque de los servicios del sistema de OpenGnSys
257
258function updateServicesStart(){
259        echoAndLog "${FUNCNAME}(): Updating /etc/init.d/opengnsys ..."
260        cp -p $WORKDIR/opengnsys/admin/Sources/Services/opengnsys.init /etc/init.d/opengnsys
261        if [ $? != 0 ]; then
262                errorAndLog "${FUNCNAME}(): Error updating /etc/init.d/opengnsys"
263                exit 1
264        fi
265        echoAndLog "${FUNCNAME}(): /etc/init.d/opengnsys updated successfully."
266}
267
268# Actualizar cliente OpenGnSys
269function updateClientFiles()
270{
271        local hayErrores=0
272
273        echoAndLog "${FUNCNAME}(): Updating OpenGnSys Client files."
274        rsync --exclude .svn -irplt $WORKDIR/opengnsys/client/shared/* $INSTALL_TARGET/client
275        if [ $? -ne 0 ]; then
276                errorAndLog "${FUNCNAME}(): error while updating client structure"
277                hayErrores=1
278        fi
279        find $INSTALL_TARGET/client -name .svn -type d -exec rm -fr {} \; 2>/dev/null
280       
281        echoAndLog "${FUNCNAME}(): Updating OpenGnSys Cloning Engine files."
282        rsync --exclude .svn -irplt $WORKDIR/opengnsys/client/engine/*.lib $INSTALL_TARGET/client/lib/engine/bin
283        if [ $? -ne 0 ]; then
284                errorAndLog "${FUNCNAME}(): error while updating engine files"
285                hayErrores=1
286        fi
287       
288        if [ $hayErrores -eq 0 ]; then
289                echoAndLog "${FUNCNAME}(): client  files update success."
290        else
291                errorAndLog "${FUNCNAME}(): client files update with errors"
292        fi
293
294        return $hayErrores
295}
296# Copiar ficheros del OpenGnSys Web Console.
297function updateWebFiles()
298{
299        local ERRCODE
300        echoAndLog "${FUNCNAME}(): Updating web files..."
301        backupFile $INSTALL_TARGET/www/controlacceso.php
302        mv $INSTALL_TARGET/www $INSTALL_TARGET/WebConsole
303        rsync --exclude .svn -irplt $WORKDIR/opengnsys/admin/WebConsole $INSTALL_TARGET
304        ERRCODE=$?
305        mv $INSTALL_TARGET/WebConsole $INSTALL_TARGET/www
306        unzip -o $WORKDIR/opengnsys/admin/xajax_0.5_standard.zip -d $INSTALL_TARGET/www/xajax
307        if [ $ERRCODE != 0 ]; then
308                errorAndLog "${FUNCNAME}(): Error updating web files."
309                exit 1
310        fi
311        restoreFile $INSTALL_TARGET/www/controlacceso.php
312        # Cambiar permisos para ficheros especiales.
313        chown -R $APACHE_RUN_USER:$APACHE_RUN_GROUP $INSTALL_TARGET/www/includes $INSTALL_TARGET/www/images/iconos
314        echoAndLog "${FUNCNAME}(): Web files updated successfully."
315       
316}
317
318# Copiar carpeta de Interface
319function updateInterfaceAdm ()
320{
321        local hayErrores=0
322         
323        # Crear carpeta y copiar Interface
324        echoAndLog "${FUNCNAME}(): Copying Administration Interface Folder"
325        mv $INSTALL_TARGET/client/interfaceAdm $INSTALL_TARGET/client/Interface
326        rsync --exclude .svn -irplt $WORKDIR/opengnsys/admin/Interface $INSTALL_TARGET/client
327        ERRCODE=$?
328        mv $INSTALL_TARGET/client/Interface $INSTALL_TARGET/client/interfaceAdm
329        if [ $? -ne 0 ]; then
330                echoAndLog "${FUNCNAME}(): error while updating admin interface"
331                exit 1
332        fi
333        chmod -R +x $INSTALL_TARGET/client/interfaceAdm
334        chown $OPENGNSYS_CLIENTUSER:$OPENGNSYS_CLIENTUSER $INSTALL_TARGET/client/interfaceAdm/CambiarAcceso
335        chmod 700 $INSTALL_TARGET/client/interfaceAdm/CambiarAcceso
336        echoAndLog "${FUNCNAME}(): Admin interface updated successfully."
337}
338
339# Crear documentación Doxygen para la consola web.
340function makeDoxygenFiles()
341{
342        echoAndLog "${FUNCNAME}(): Making Doxygen web files..."
343        $WORKDIR/opengnsys/installer/ogGenerateDoc.sh \
344                        $WORKDIR/opengnsys/client/engine $INSTALL_TARGET/www
345        if [ ! -d "$INSTALL_TARGET/www/html" ]; then
346                errorAndLog "${FUNCNAME}(): unable to create Doxygen web files."
347                return 1
348        fi
349        rm -fr "$INSTALL_TARGET/www/api"
350        mv "$INSTALL_TARGET/www/html" "$INSTALL_TARGET/www/api"
351    rm -fr $INSTALL_TARGET/www/{man,perlmod,rtf}
352        chown -R $APACHE_RUN_USER:$APACHE_RUN_GROUP $INSTALL_TARGET/www/api
353        echoAndLog "${FUNCNAME}(): Doxygen web files created successfully."
354}
355
356
357# Crea la estructura base de la instalación de opengnsys
358function createDirs()
359{
360        echoAndLog "${FUNCNAME}(): creating directory paths in ${INSTALL_TARGET}"
361
362        mkdir -p ${INSTALL_TARGET}
363        mkdir -p ${INSTALL_TARGET}/bin
364        mkdir -p ${INSTALL_TARGET}/client
365        mkdir -p ${INSTALL_TARGET}/doc
366        mkdir -p ${INSTALL_TARGET}/etc
367        mkdir -p ${INSTALL_TARGET}/lib
368        mkdir -p ${INSTALL_TARGET}/log/clients
369        mkdir -p ${INSTALL_TARGET}/sbin
370        mkdir -p ${INSTALL_TARGET}/www
371        mkdir -p ${INSTALL_TARGET}/images
372        ln -fs /var/lib/tftpboot ${INSTALL_TARGET}
373        ln -fs ${INSTALL_TARGET}/log /var/log/opengnsys
374
375        if [ $? -ne 0 ]; then
376                errorAndLog "${FUNCNAME}(): error while creating dirs. Do you have write permissions?"
377                return 1
378        fi
379
380        echoAndLog "${FUNCNAME}(): directory paths created"
381        return 0
382}
383
384# Copia ficheros de configuración y ejecutables genéricos del servidor.
385function updateServerFiles () {
386
387        # No copiar ficheros del antiguo cliente Initrd
388        local SOURCES=( repoman/bin \
389                        server/bin \
390                        doc )
391        local TARGETS=( bin \
392                        bin \
393                        doc )
394
395        if [ ${#SOURCES[@]} != ${#TARGETS[@]} ]; then
396                errorAndLog "${FUNCNAME}(): inconsistent number of array items"
397                exit 1
398        fi
399
400        echoAndLog "${FUNCNAME}(): updating files in server directories"
401        pushd $WORKDIR/opengnsys >/dev/null
402        local i
403        for (( i = 0; i < ${#SOURCES[@]}; i++ )); do
404                rsync --exclude .svn -irplt "${SOURCES[$i]}" $(dirname "${INSTALL_TARGET}/${TARGETS[$i]}")
405        done
406        popd >/dev/null
407        echoAndLog "${FUNCNAME}(): updating cron files"
408        echo "* * * * *   root   [ -x $INSTALL_TARGET/bin/torrent-creator ] && $INSTALL_TARGET/bin/torrent-creator" > /etc/cron.d/torrentcreator
409        echoAndLog "${FUNCNAME}(): server files updated successfully."
410}
411
412####################################################################
413### Funciones de compilación de código fuente de servicios
414####################################################################
415
416# Recompilar y actualiza el binario del clinete
417function recompileClient ()
418{
419        # Compilar OpenGnSys Client
420        echoAndLog "${FUNCNAME}(): recompiling OpenGnSys Client"
421        pushd $WORKDIR/opengnsys/admin/Sources/Clients/ogAdmClient
422        make && mv ogAdmClient $INSTALL_TARGET/client/bin
423        if [ $? -ne 0 ]; then
424                echoAndLog "${FUNCNAME}(): error while compiling OpenGnSys Client"
425                hayErrores=1
426        fi
427        popd
428
429        return $hayErrores
430}
431
432
433####################################################################
434### Funciones instalacion cliente opengnsys
435####################################################################
436
437# Actualizar antiguo cliente Initrd.
438function updateOldClient()
439{
440        local OSDISTRIB OSCODENAME
441
442        local hayErrores=0
443
444        echoAndLog "${FUNCNAME}(): Copying OpenGnSys Client files."
445        rsync --exclude .svn -irplt $WORKDIR/opengnsys/client/nfsexport/* $INSTALL_TARGET/client
446        echoAndLog "${FUNCNAME}(): Copying OpenGnSys Cloning Engine files."
447        mkdir -p $INSTALL_TARGET/client/lib/engine/bin
448        rsync -iplt $WORKDIR/opengnsys/client/engine/*.lib $INSTALL_TARGET/client/lib/engine/bin
449        if [ $? -ne 0 ]; then
450                errorAndLog "${FUNCNAME}(): error while copying engine files"
451                hayErrores=1
452        fi
453
454        # Cargar Kernel, Initrd y paquetes udeb para la distribución del servidor (o por defecto).
455        OSDISTRIB=$(lsb_release -is) 2>/dev/null
456        OSCODENAME=$(lsb_release -cs) 2>/dev/null
457        if [ "$OSDISTRIB" = "Ubuntu" -a -n "$OSCODENAME" ]; then
458                echoAndLog "${FUNCNAME}(): Loading Kernel and Initrd files for $OSDISTRIB $OSCODENAME."
459                $INSTALL_TARGET/bin/initrd-generator -t $INSTALL_TARGET/tftpboot -v $OSCODENAME 2>&1 | tee -a $LOG_FILE
460                if [ $? -ne 0 ]; then
461                        errorAndLog "${FUNCNAME}(): error while generating initrd OpenGnSys Admin Client"
462                        hayErrores=1
463                fi
464                echoAndLog "${FUNCNAME}(): Loading udeb files for $OSDISTRIB $OSCODENAME."
465                $INSTALL_TARGET/bin/upgrade-clients-udeb.sh $OSCODENAME 2>&1 | tee -a $LOG_FILE
466                if [ $? -ne 0 ]; then
467                        errorAndLog "${FUNCNAME}(): error while upgrading udeb files OpenGnSys Admin Client"
468                        hayErrores=1
469                fi
470        else
471                echoAndLog "${FUNCNAME}(): Loading default Kernel and Initrd files."
472                $INSTALL_TARGET/bin/initrd-generator -t $INSTALL_TARGET/tftpboot 2>&1 | tee -a $LOG_FILE
473                if [ $? -ne 0 ]; then
474                        errorAndLog "${FUNCNAME}(): error while generating initrd OpenGnSys Admin Client"
475                        hayErrores=1
476                fi
477                echoAndLog "${FUNCNAME}(): Loading default udeb files."
478                $INSTALL_TARGET/bin/upgrade-clients-udeb.sh 2>&1 | tee -a $LOG_FILE
479                if [ $? -ne 0 ]; then
480                        errorAndLog "${FUNCNAME}(): error while upgrading udeb files OpenGnSys Admin Client"
481                        hayErrores=1
482                fi
483        fi
484
485        if [ $hayErrores -eq 0 ]; then
486                echoAndLog "${FUNCNAME}(): Client generation success."
487        else
488                errorAndLog "${FUNCNAME}(): Client generation with errors"
489        fi
490
491        return $hayErrores
492}
493
494# Actualizar nuevo cliente para OpenGnSys 1.0
495function updateClient()
496{
497        local DOWNLOADURL=http://www.opengnsys.es/downloads
498        local FILENAME=ogclient-1.0.1-lucid-32bit.tar.gz
499        local TMPFILE=/tmp/$FILENAME
500
501        echoAndLog "${FUNCNAME}(): Loading Client"
502        # Descargar y descomprimir cliente ogclient
503        wget $DOWNLOADURL/$FILENAME -O $TMPFILE
504        if [ ! -s $TMPFILE ]; then
505                errorAndLog "${FUNCNAME}(): Error loading OpenGnSys Client"
506                return 1
507        fi
508        echoAndLog "${FUNCNAME}(): Extracting Client files"
509        tar xzvf $TMPFILE -C $INSTALL_TARGET/tftpboot
510        rm -f $TMPFILE
511        # Usar la versión más reciente del Kernel y del Initrd para el cliente.
512        ln -f $(ls $INSTALL_TARGET/tftpboot/ogclient/vmlinuz-*|tail -1) $INSTALL_TARGET/tftpboot/ogclient/ogvmlinuz
513        ln -f $(ls $INSTALL_TARGET/tftpboot/ogclient/initrd.img-*|tail -1) $INSTALL_TARGET/tftpboot/ogclient/oginitrd.img
514        # Establecer los permisos.
515        chmod -R 755 $INSTALL_TARGET/tftpboot/ogclient
516        chown -R :$OPENGNSYS_CLIENTUSER $INSTALL_TARGET/tftpboot/ogclient
517        echoAndLog "${FUNCNAME}(): Client update successfully"
518}
519
520
521#####################################################################
522####### Proceso de actualización de OpenGnSys
523#####################################################################
524
525
526echoAndLog "OpenGnSys update begins at $(date)"
527
528# Instalar dependencia.
529installDependencies $DEPS
530if [ $? -ne 0 ]; then
531        errorAndLog "Error: you may install all needed dependencies."
532        exit 1
533fi
534
535pushd $WORKDIR
536
537# Comprobar si hay conexión y detectar parámetros de red por defecto.
538checkNetworkConnection
539if [ $? -ne 0 ]; then
540        errorAndLog "Error connecting to server. Causes:"
541        errorAndLog " - Network is unreachable, review devices parameters."
542        errorAndLog " - You are inside a private network, configure the proxy service."
543        errorAndLog " - Server is temporally down, try agian later."
544        exit 1
545fi
546getNetworkSettings
547if [ $? -ne 0 ]; then
548        errorAndLog "Error reading default network settings."
549        exit 1
550fi
551
552# Arbol de directorios de OpenGnSys.
553createDirs ${INSTALL_TARGET}
554if [ $? -ne 0 ]; then
555        errorAndLog "Error while creating directory paths!"
556        exit 1
557fi
558
559# Si es necesario, descarga el repositorio de código en directorio temporal
560if [ $USESVN -eq 1 ]; then
561        svnExportCode $SVN_URL
562        if [ $? -ne 0 ]; then
563                errorAndLog "Error while getting code from svn"
564                exit 1
565        fi
566else
567        ln -fs "$(dirname $PROGRAMDIR)" opengnsys
568fi
569
570# Si existe fichero de actualización de la base de datos; aplicar cambios.
571INSTVERSION=$(awk '{print $2}' $INSTALL_TARGET/doc/VERSION.txt)
572REPOVERSION=$(awk '{print $2}' $WORKDIR/opengnsys/doc/VERSION.txt)
573OPENGNSYS_DBUPDATEFILE="$WORKDIR/opengnsys/admin/Database/$OPENGNSYS_DATABASE-$INSTVERSION-$REPOVERSION.sql"
574if [ -f $OPENGNSYS_DBUPDATEFILE ]; then
575        echoAndLog "Updating tables from version $INSTVERSION to $REPOVERSION"
576        importSqlFile $OPENGNSYS_DBUSER $OPENGNSYS_DBPASSWORD $OPENGNSYS_DATABASE $OPENGNSYS_DBUPDATEFILE
577else
578        echoAndLog "Database unchanged."
579fi
580
581# Actualizar ficheros complementarios del servidor
582updateServerFiles
583if [ $? -ne 0 ]; then
584        errorAndLog "Error updating OpenGnSys Server files"
585        exit 1
586fi
587
588# Actualizar ficheros del cliente
589updateClientFiles
590updateInterfaceAdm
591
592# Actualizar páqinas web
593updateWebFiles
594if [ $? -ne 0 ]; then
595        errorAndLog "Error updating OpenGnSys Web Admin files"
596        exit 1
597fi
598# Generar páginas Doxygen para instalar en el web
599makeDoxygenFiles
600
601# Creando la estructura del cliente
602recompileClient
603# NO se actualiza el antiguo cliente Initrd
604#updateOldClient
605updateClient
606if [ $? -ne 0 ]; then
607        errorAndLog "Error updating clients"
608        exit 1
609fi
610
611# Actualizamos el fichero que arranca los servicios de OpenGnSys
612updateServicesStart
613
614# Eliminamos el fichero de estado del tracker porque es incompatible entre los distintos paquetes
615if [ -f /tmp/dstate ]; then
616        rm -f /tmp/dstate
617fi
618
619#rm -rf $WORKDIR
620echoAndLog "OpenGnSys update finished at $(date)"
621
622popd
623
Note: See TracBrowser for help on using the repository browser.