diff options
197 files changed, 3116 insertions, 2284 deletions
@@ -18,6 +18,5 @@ OpenGnsys website: https://opengnsys.es/ ## Installation notes -Please, read installer/README.en.txt (or installer/README.es.txt) for detailled -instructions. +Please, read `installer/INSTALL.en.txt` (or `installer/INSTALL.es.txt`) for detailled instructions. diff --git a/admin/Database/ogAdmBD-1.0.6b-1.1.0.sql b/admin/Database/ogAdmBD-1.0.6b-1.1.0a.sql index 8db4d183..8db4d183 100644 --- a/admin/Database/ogAdmBD-1.0.6b-1.1.0.sql +++ b/admin/Database/ogAdmBD-1.0.6b-1.1.0a.sql diff --git a/admin/Database/ogAdmBD-1.1.0-1.1.1pre.sql b/admin/Database/ogAdmBD-1.1.0a-1.1.1pre.sql index 435613a0..d0b3e0a7 100644 --- a/admin/Database/ogAdmBD-1.1.0-1.1.1pre.sql +++ b/admin/Database/ogAdmBD-1.1.0a-1.1.1pre.sql @@ -1,8 +1,13 @@ ### Fichero de actualización de la base de datos. -# OpenGnsys 1.1.0 - OpenGnsys 1.1.1 +# OpenGnsys 1.1.0, 1.1.0a - OpenGnsys 1.1.1 #use ogAdmBD # Añadir campo para incluir PC de profesor de aula (ticket #816). ALTER TABLE aulas ADD idordprofesor INT(11) DEFAULT 0 AFTER puestos; +# Borrar campos sin uso del antiguo servicio ogAdmRepo (ticket #875). +ALTER TABLE repositorios + DROP passguor, + DROP puertorepo; + diff --git a/admin/Database/ogAdmBD-1.1.0pre-1.1.0.sql b/admin/Database/ogAdmBD-1.1.0pre-1.1.0a.sql index 131e7ba7..131e7ba7 100644 --- a/admin/Database/ogAdmBD-1.1.0pre-1.1.0.sql +++ b/admin/Database/ogAdmBD-1.1.0pre-1.1.0a.sql diff --git a/admin/Database/ogAdmBD-1.1.1pre.sql b/admin/Database/ogAdmBD-1.1.1pre.sql index 8d815040..0f03188b 100644 --- a/admin/Database/ogAdmBD-1.1.1pre.sql +++ b/admin/Database/ogAdmBD-1.1.1pre.sql @@ -14,6 +14,14 @@ CREATE PROCEDURE addcols() BEGIN ALTER TABLE aulas ADD idordprofesor INT(11) DEFAULT 0 AFTER puestos; END IF; + # Borrar campos sin uso del antiguo servicio ogAdmRepo (ticket #875). + IF EXISTS (SELECT * FROM information_schema.COLUMNS + WHERE COLUMN_NAME='puertorepo' AND TABLE_NAME='repositorios' AND TABLE_SCHEMA=DATABASE()) + THEN + ALTER TABLE repositorios + DROP passguor, + DROP puertorepo; + END IF; END// # Ejecutar actualización condicional. DELIMITER ';' diff --git a/admin/Database/ogAdmBD.sql b/admin/Database/ogAdmBD.sql index 422ace93..372398e4 100644 --- a/admin/Database/ogAdmBD.sql +++ b/admin/Database/ogAdmBD.sql @@ -807,17 +807,15 @@ CREATE TABLE `repositorios` ( `idrepositorio` int(11) NOT NULL AUTO_INCREMENT, `nombrerepositorio` varchar(250) NOT NULL DEFAULT '', `ip` varchar(15) NOT NULL DEFAULT '', - `passguor` varchar(50) NOT NULL DEFAULT '', `idcentro` int(11) DEFAULT NULL, `grupoid` int(11) DEFAULT NULL, `comentarios` text, - `puertorepo` int(11) NOT NULL DEFAULT '0', `apikey` varchar(32) NOT NULL DEFAULT '', PRIMARY KEY (`idrepositorio`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; -INSERT INTO `repositorios` (`idrepositorio`,`nombrerepositorio`,`ip`,`passguor`,`idcentro`,`grupoid`,`comentarios`,`puertorepo`,`apikey`) VALUES - (1,'Repositorio (Default)','SERVERIP','',1,0,'',2002,'REPOKEY'); +INSERT INTO `repositorios` (`idrepositorio`,`nombrerepositorio`,`ip`,`idcentro`,`grupoid`,`comentarios`,`apikey`) VALUES + (1,'Repositorio (Default)','SERVERIP',1,0,'','REPOKEY'); -- -------------------------------------------------------- diff --git a/admin/Sources/Clients/ogagent/src/opengnsys/linux/operations.py b/admin/Sources/Clients/ogagent/src/opengnsys/linux/operations.py index f9534d6a..0c08f95f 100644 --- a/admin/Sources/Clients/ogagent/src/opengnsys/linux/operations.py +++ b/admin/Sources/Clients/ogagent/src/opengnsys/linux/operations.py @@ -284,3 +284,11 @@ def showPopup(title, message): Displays a message box on user's session (during 1 min). ''' return subprocess.call('zenity --info --timeout 60 --title "{}" --text "{}"'.format(title, message), shell=True) + + +def get_etc_path(): + """ + :return: + Returns etc directory path. + """ + return os.sep + 'etc' diff --git a/admin/Sources/Clients/ogagent/src/opengnsys/macos/operations.py b/admin/Sources/Clients/ogagent/src/opengnsys/macos/operations.py index ea835cea..286b6d89 100644 --- a/admin/Sources/Clients/ogagent/src/opengnsys/macos/operations.py +++ b/admin/Sources/Clients/ogagent/src/opengnsys/macos/operations.py @@ -253,3 +253,11 @@ def showPopup(title, message): ''' # Show a dialog using AppleSctipt return subprocess.call('/usr/bin/osascript -e \'display notification "{}" with title "{}"\''.format(message, title), shell=True) + + +def get_etc_path(): + """ + :return: + Returns etc directory path. + """ + return os.sep + 'etc' diff --git a/admin/Sources/Clients/ogagent/src/opengnsys/modules/server/OpenGnSys/__init__.py b/admin/Sources/Clients/ogagent/src/opengnsys/modules/server/OpenGnSys/__init__.py index 1438e469..8ef866ad 100644 --- a/admin/Sources/Clients/ogagent/src/opengnsys/modules/server/OpenGnSys/__init__.py +++ b/admin/Sources/Clients/ogagent/src/opengnsys/modules/server/OpenGnSys/__init__.py @@ -37,6 +37,7 @@ import os import platform import time import random +import shutil import string import urllib @@ -65,9 +66,9 @@ class OpenGnSysWorker(ServerWorker): length = 32 # Random string length def checkSecret(self, server): - ''' + """ Checks for received secret key and raise exception if it isn't valid. - ''' + """ try: if self.random != server.headers['Authorization']: raise Exception('Unauthorized operation') @@ -76,9 +77,9 @@ class OpenGnSysWorker(ServerWorker): raise Exception(e) def onActivation(self): - ''' + """ Sends OGAgent activation notification to OpenGnsys server - ''' + """ self.cmd = None # Ensure cfg has required configuration variables or an exception will be thrown self.REST = REST(self.service.config.get('opengnsys', 'remote')) @@ -104,55 +105,64 @@ class OpenGnSysWorker(ServerWorker): os.remove(os.sep + f) except OSError: pass + # Copy file "HostsFile.FirstOctetOfIPAddress" to "HostsFile", if it exists + # (used in "exam mode" of the University of Seville) + hostsFile = os.path.join(operations.get_etc_path(), 'hosts') + newHostsFile = hostsFile + '.' + self.interface.ip.split('.')[0] + if os.path.isfile(newHostsFile): + shutil.copyfile(newHostsFile, hostsFile) # Generate random secret to send on activation self.random = ''.join(random.choice(string.ascii_lowercase + string.digits) for _ in range(self.length)) - # Send initalization message + # Send initialization message self.REST.sendMessage('ogagent/started', {'mac': self.interface.mac, 'ip': self.interface.ip, 'secret': self.random, 'ostype': operations.osType, 'osversion': operations.osVersion}) def onDeactivation(self): - ''' + """ Sends OGAgent stopping notification to OpenGnsys server - ''' + """ logger.debug('onDeactivation') self.REST.sendMessage('ogagent/stopped', {'mac': self.interface.mac, 'ip': self.interface.ip, 'ostype': operations.osType, 'osversion': operations.osVersion}) def processClientMessage(self, message, data): logger.debug('Got OpenGnsys message from client: {}, data {}'.format(message, data)) - def onLogin(self, userData): - ''' + def onLogin(self, data): + """ Sends session login notification to OpenGnsys server - ''' - user, sep, language = userData.partition(',') + """ + user, sep, language = data.partition(',') logger.debug('Received login for {} with language {}'.format(user, language)) self.loggedin = True self.REST.sendMessage('ogagent/loggedin', {'ip': self.interface.ip, 'user': user, 'language': language, 'ostype': operations.osType, 'osversion': operations.osVersion}) def onLogout(self, user): - ''' + """ Sends session logout notification to OpenGnsys server - ''' + """ logger.debug('Received logout for {}'.format(user)) self.loggedin = False self.REST.sendMessage('ogagent/loggedout', {'ip': self.interface.ip, 'user': user}) def process_ogclient(self, path, getParams, postParams, server): - ''' - This method can be overriden to provide your own message proccessor, or better you can - implement a method that is called exactly as "process_" + path[0] (module name has been removed from path array) and this default processMessage will invoke it + """ + This method can be overridden to provide your own message processor, or better you can + implement a method that is called exactly as "process_" + path[0] (module name has been removed from path + array) and this default processMessage will invoke it * Example: Imagine this invocation url (no matter if GET or POST): http://example.com:9999/Sample/mazinger/Z The HTTP Server will remove "Sample" from path, parse arguments and invoke this method as this: module.processMessage(["mazinger","Z"], getParams, postParams) - This method will process "mazinger", and look for a "self" method that is called "process_mazinger", and invoke it this way: + This method will process "mazinger", and look for a "self" method that is called "process_mazinger", + and invoke it this way: return self.process_mazinger(["Z"], getParams, postParams) - In the case path is empty (that is, the path is composed only by the module name, like in "http://example.com/Sample", the "process" method - will be invoked directly + In the case path is empty (that is, the path is composed only by the module name, like in + "http://example.com/Sample", the "process" method will be invoked directly - The methods must return data that can be serialized to json (i.e. Ojects are not serializable to json, basic type are) - ''' + The methods must return data that can be serialized to json (i.e. Objects are not serializable to json, + basic type are) + """ if not path: return "ok" try: @@ -162,9 +172,9 @@ class OpenGnSysWorker(ServerWorker): return operation(path[1:], getParams, postParams) def process_status(self, path, getParams, postParams, server): - ''' + """ Returns client status. - ''' + """ res = {'status': '', 'loggedin': self.loggedin} if platform.system() == 'Linux': # GNU/Linux # Check if it's OpenGnsys Client. @@ -185,9 +195,9 @@ class OpenGnSysWorker(ServerWorker): return res def process_reboot(self, path, getParams, postParams, server): - ''' + """ Launches a system reboot operation. - ''' + """ logger.debug('Received reboot operation') self.checkSecret(server) # Rebooting thread. @@ -197,9 +207,9 @@ class OpenGnSysWorker(ServerWorker): return {'op': 'launched'} def process_poweroff(self, path, getParams, postParams, server): - ''' + """ Launches a system power off operation. - ''' + """ logger.debug('Received poweroff operation') self.checkSecret(server) # Powering off thread. @@ -210,9 +220,9 @@ class OpenGnSysWorker(ServerWorker): return {'op': 'launched'} def process_script(self, path, getParams, postParams, server): - ''' + """ Processes an script execution (script should be encoded in base64) - ''' + """ logger.debug('Processing script request') self.checkSecret(server) # Decoding script. @@ -227,19 +237,19 @@ class OpenGnSysWorker(ServerWorker): return {'op': 'launched'} def process_logoff(self, path, getParams, postParams, server): - ''' + """ Closes user session. - ''' + """ logger.debug('Received logoff operation') self.checkSecret(server) # Sending log off message to OGAgent client. self.sendClientMessage('logoff', {}) - return {'op': 'sended to client'} + return {'op': 'sent to client'} def process_popup(self, path, getParams, postParams, server): - ''' + """ Shows a message popup on the user's session. - ''' + """ logger.debug('Received message operation') self.checkSecret(server) # Sending popup message to OGAgent client. diff --git a/admin/Sources/Clients/ogagent/src/opengnsys/windows/operations.py b/admin/Sources/Clients/ogagent/src/opengnsys/windows/operations.py index aa83c943..95331fd0 100644 --- a/admin/Sources/Clients/ogagent/src/opengnsys/windows/operations.py +++ b/admin/Sources/Clients/ogagent/src/opengnsys/windows/operations.py @@ -259,3 +259,11 @@ def showPopup(title, message): Displays a message box on user's session (during 1 min). ''' return subprocess.call('mshta "javascript:var sh=new ActiveXObject(\'WScript.Shell\'); sh.Popup( \'{}\', 60, \'{}\', 64); close()"'.format(message.encode('unicode_escape'), title.encode('unicode_escape')), shell=True) + + +def get_etc_path(): + """ + :return: + Returns etc directory path. + """ + return os.path.join('C:', os.sep, 'Windows', 'System32', 'drivers', 'etc') diff --git a/admin/Sources/Services/ogAdmRepo/Makefile b/admin/Sources/Services/ogAdmRepo/Makefile deleted file mode 100644 index d7b3591d..00000000 --- a/admin/Sources/Services/ogAdmRepo/Makefile +++ /dev/null @@ -1,44 +0,0 @@ -# makefile - -# Nombre del proyecto -PROYECTO := ogAdmRepo - -#Directorio de instalación -INSTALL_DIR := /opt/opengnsys - -# Opciones de compilacion -CFLAGS := $(shell mysql_config --cflags) -CFLAGS += -O0 -g -Wall -I../../Includes # Depuracion -#CFLAGS += -O3 -I../../Includes # Optimizacion -CPPFLAGS := $(CFLAGS) - -# Opciones de linkado -LDFLAGS := -Wl,--no-as-needed $(shell mysql_config --libs) -lpthread - -# Ficheros objetos -OBJS := ../../Includes/Database.o sources/ogAdmRepo.o - - -all: $(PROYECTO) - -$(PROYECTO): $(OBJS) - g++ $(LDFLAGS) $(OBJS) -o $(PROYECTO) -# strip $(PROYECTO) # Optimizacion - -install: $(PROYECTO) - cp $(PROYECTO) $(INSTALL_DIR)/sbin - cp $(PROYECTO).cfg $(INSTALL_DIR)/etc - -clean: - rm -f $(PROYECTO) $(OBJS) - -uninstall: clean - rm -f /usr/local/sbin/$(PROYECTO) /usr/local/etc/$(PROYECTO).cfg - -sources/%.o: sources/%.cpp - g++ $(CPPFLAGS) -c -o"$@" "$<" - -sources/%.o: sources/%.c - gcc $(CFLAGS) -c -o"$@" "$<" - - diff --git a/admin/Sources/Services/ogAdmRepo/sources/ogAdmRepo.cpp b/admin/Sources/Services/ogAdmRepo/sources/ogAdmRepo.cpp deleted file mode 100644 index 067b6af0..00000000 --- a/admin/Sources/Services/ogAdmRepo/sources/ogAdmRepo.cpp +++ /dev/null @@ -1,177 +0,0 @@ -// ******************************************************************************************************** -// Servicio: ogAdmRepo -// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla -// Fecha Creación: Marzo-2010 -// Fecha Última modificación: Marzo-2010 -// Nombre del fichero: ogAdmRepo.cpp -// Descripción :Este fichero implementa el servicio de administración general del sistema -// ******************************************************************************************************** -#include "ogAdmRepo.h" -#include "ogAdmLib.c" -//________________________________________________________________________________________________________ -// Función: tomaConfiguracion -// -// Descripción: -// Lee el fichero de configuración del servicio -// Parámetros: -// filecfg : Ruta completa al fichero de configuración -// Devuelve: -// TRUE: Si el proceso es correcto -// FALSE: En caso de ocurrir algún error -//________________________________________________________________________________________________________ -BOOLEAN tomaConfiguracion(char* filecfg) { - char modulo[] = "tomaConfiguracion()"; - - if (filecfg == NULL || strlen(filecfg) == 0) { - errorLog(modulo, 1, FALSE); // Fichero de configuración del servicio vacío - return (FALSE); - } - FILE *fcfg; - long lSize; - char * buffer, *lineas[MAXPRM], *dualparametro[2]; - int i, numlin, resul; - - fcfg = fopen(filecfg, "rt"); - if (fcfg == NULL) { - errorLog(modulo, 2, FALSE); // No existe fichero de configuración del servicio - return (FALSE); - } - - fseek(fcfg, 0, SEEK_END); - lSize = ftell(fcfg); // Obtiene tamaño del fichero. - rewind(fcfg); - buffer = (char*) reservaMemoria(lSize+1); // Toma memoria para el buffer de lectura. - if (buffer == NULL) { // No hay memoria suficiente para el buffer - errorLog(modulo, 3, FALSE); - return (FALSE); - } - fread(buffer, 1, lSize, fcfg); // Lee contenido del fichero - buffer[lSize]=(char) NULL; - fclose(fcfg); - - iplocal[0] = (char) NULL; //inicializar variables globales - puerto[0] = (char) NULL; - - numlin = splitCadena(lineas, buffer, '\n'); - for (i = 0; i < numlin; i++) { - splitCadena(dualparametro, lineas[i], '='); - resul = strcmp(StrToUpper(dualparametro[0]), "IPLOCAL"); - if (resul == 0) - strcpy(iplocal, dualparametro[1]); - resul = strcmp(StrToUpper(dualparametro[0]), "PUERTO"); - if (resul == 0) - strcpy(puerto, dualparametro[1]); - } - if (iplocal[0] == (char) NULL) { - errorLog(modulo, 4, FALSE); // Falta parámetro IPLOCAL - return (FALSE); - } - if (puerto[0] == (char) NULL) { - errorLog(modulo, 5, FALSE); // Falta parámetro PUERTO - return (FALSE); - } - return (TRUE); -} -// ________________________________________________________________________________________________________ -// Función: gestionaTrama -// -// Descripción: -// Procesa las tramas recibidas . -// Parametros: -// - s : Socket usado para comunicaciones -// Devuelve: -// TRUE: Si el proceso es correcto -// FALSE: En caso de ocurrir algún error -// ________________________________________________________________________________________________________ -BOOLEAN gestionaTrama(SOCKET *socket_c) -{ - TRAMA* ptrTrama; - int i, res; - char *nfn; - char modulo[] = "gestionaTrama()"; - - ptrTrama=recibeTrama(socket_c); - if (ptrTrama){ - INTROaFINCAD(ptrTrama); - nfn = copiaParametro("nfn",ptrTrama); // Toma dirección/es IP - for (i = 0; i < MAXIMAS_FUNCIONES; i++) { // Recorre funciones que procesan las tramas - res = strcmp(tbfuncionesRepo[i].nf, nfn); - if (res == 0) { // Encontrada la función que procesa el mensaje - return (tbfuncionesRepo[i].fptr(socket_c, ptrTrama)); // Invoca la función - } - } - } - else - errorLog(modulo, 17, FALSE); // Error en la recepción - return (TRUE); -} -// ******************************************************************************************************** -// PROGRAMA PRINCIPAL (SERVICIO) -// ******************************************************************************************************** -int main(int argc, char *argv[]) -{ - SOCKET socket_r; // Socket donde escucha el servidor - SOCKET socket_c; // Socket de los clientes que se conectan - socklen_t iAddrSize; - struct sockaddr_in local, cliente; - char modulo[] = "main()"; - - /*-------------------------------------------------------------------------------------------------------- - Validación de parámetros de ejecución y lectura del fichero de configuración del servicio - ---------------------------------------------------------------------------------------------------------*/ - if (!validacionParametros(argc, argv,1)) // Valida parámetros de ejecución - exit(EXIT_FAILURE); - - if (!tomaConfiguracion(szPathFileCfg)) { // Toma parametros de configuracion - exit(EXIT_FAILURE); - } - /*-------------------------------------------------------------------------------------------------------- - Carga del catálogo de funciones que procesan las tramas (referencia directa por puntero a función) - ---------------------------------------------------------------------------------------------------------*/ - int cf = 0; - - cf++; - - - /*-------------------------------------------------------------------------------------------------------- - Creación y configuración del socket del servicio - ---------------------------------------------------------------------------------------------------------*/ - socket_r = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); // Crea socket del servicio - if (socket_r == SOCKET_ERROR) { // Error al crear el socket del servicio - errorLog(modulo, 13, TRUE); - exit(EXIT_FAILURE); - } - - local.sin_addr.s_addr = htonl(INADDR_ANY); // Configura el socket del servicio - local.sin_family = AF_INET; - local.sin_port = htons(atoi(puerto)); - - if (bind(socket_r, (struct sockaddr *) &local, sizeof(local))== SOCKET_ERROR) { // Enlaza socket - errorLog(modulo, 14, TRUE); - exit(EXIT_FAILURE); - } - - listen(socket_r, 250); // Pone a escuchar al socket - iAddrSize = sizeof(cliente); - /*-------------------------------------------------------------------------------------------------------- - Bucle para acceptar conexiones - ---------------------------------------------------------------------------------------------------------*/ - infoLog(1); // Inicio de sesión - while(TRUE) { - socket_c = accept(socket_r, (struct sockaddr *) &cliente, &iAddrSize); - if (socket_c == INVALID_SOCKET) { - errorLog(modulo, 15, TRUE); - exit(EXIT_FAILURE); - } - if(!gestionaTrama(&socket_c)){ - errorLog(modulo, 39, TRUE); - break; - } - close(socket_c); - } - /*-------------------------------------------------------------------------------------------------------- - Fin del servicio - ---------------------------------------------------------------------------------------------------------*/ - close(socket_r); - exit(EXIT_SUCCESS); -} diff --git a/admin/Sources/Services/ogAdmRepo/sources/ogAdmRepo.h b/admin/Sources/Services/ogAdmRepo/sources/ogAdmRepo.h deleted file mode 100644 index 8051f3f6..00000000 --- a/admin/Sources/Services/ogAdmRepo/sources/ogAdmRepo.h +++ /dev/null @@ -1,41 +0,0 @@ -// ******************************************************************************************************** -// Servicio: ogAdmRepo -// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla -// Fecha Creación: Marzo-2010 -// Fecha Última modificación: Marzo-2010 -// Nombre del fichero: ogAdmRepo.h -// Descripción: Este fichero implementa el servicio de repositorio de imágenes -// ******************************************************************************************************** -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <ctype.h> -#include <errno.h> -#include <unistd.h> -#include <time.h> -#include <sys/types.h> -#include <sys/socket.h> -#include <netinet/in.h> -#include <arpa/inet.h> -#include "ogAdmLib.h" -// ________________________________________________________________________________________________________ -// Variables globales -// ________________________________________________________________________________________________________ -char iplocal[LONPRM]; // Dirección IP del servidor de administración -char puerto[LONPRM]; // Puerto de comunicación - -char servidoradm[LONIP]; // IP del servidor - -typedef struct{ // Estructura usada para referenciar las funciones que procesan las tramas - char nf[LONFUN]; // Nombre de la función - BOOLEAN (*fptr)(SOCKET*,TRAMA*); // Puntero a la función que procesa la trama -}MSGFUN; - -MSGFUN tbfuncionesRepo[MAXIMAS_FUNCIONES]; - -// ________________________________________________________________________________________________________ -// Prototipo de funciones -// ________________________________________________________________________________________________________ -BOOLEAN tomaConfiguracion(char*); -BOOLEAN gestionaTrama(SOCKET*); -BOOLEAN tomaConfiguracion(char*); diff --git a/admin/Sources/Services/opengnsys.default b/admin/Sources/Services/opengnsys.default index 644f516a..9af83e29 100644 --- a/admin/Sources/Services/opengnsys.default +++ b/admin/Sources/Services/opengnsys.default @@ -1,7 +1,8 @@ -# RUN_OGADMSERVER run OpenGnsys Admin service. -# RUN_OGADMREPO run OpenGnsys Repository Manager service. +# RUN_OGADMSERVER defined as OpenGnsys Admin Server +# RUN_OGADMREPO defined as OpenGnsys Repository Manager +# RUN_OGADMAGENT run task scheduler service # RUN_BTTRACKER run Bittorrent Tracker -# RUN_BTSEEDER starts seeding of selected torrent files +# RUN_BTSEEDER start seeding of selected torrent files # RUN_CRON run Cron script to check started processes RUN_OGADMSERVER="yes" RUN_OGADMREPO="yes" diff --git a/admin/Sources/Services/opengnsys.init b/admin/Sources/Services/opengnsys.init index 548843fa..ae27593b 100755 --- a/admin/Sources/Services/opengnsys.init +++ b/admin/Sources/Services/opengnsys.init @@ -30,11 +30,6 @@ SERVERDAEMON_OPTIONS="-f $SERVERCFG -l $SERVERLOG" # # Servidor de Repositorio # -REPONAME=ogAdmRepo -REPODAEMON=$BASEDIR/sbin/$REPONAME -REPOCFG=$BASEDIR/etc/$REPONAME.cfg -REPOLOG=$BASEDIR/log/$REPONAME.log -REPODAEMON_OPTIONS="-f $REPOCFG -l $REPOLOG" ############## ADV REPOAUXNAME=ogAdmRepoAux REPOAUXDAEMON=$BASEDIR/sbin/$REPOAUXNAME @@ -155,17 +150,14 @@ arranca_demonios() { faucet $SERVERAUXPORT --daemon --in bash -c "$SERVERAUXDAEMON" # NUEVO [ $? = 0 ] && $SUCCESSMSG || $FAILMSG fi - if [ $RUN_OGADMSERVER = "yes" ] && [ $RUN_OGADMREPO = "yes" ]; then - sleep 5 # Damos tiempo a que ogAdmServer este funcionando - fi if [ $RUN_OGADMREPO = "yes" ]; then - $ACTIONMSG "Iniciando demonio: $REPONAME" - $DAEMONSTART $REPODAEMON $EXTRAOPTS $REPODAEMON_OPTIONS $ENDOPTS - [ $? = 0 ] && $SUCCESSMSG || $FAILMSG $ACTIONMSG "Iniciando demonio: $REPOAUXNAME" faucet $REPOAUXPORT --daemon --in bash -c "$REPOAUXDAEMON" [ $? = 0 ] && $SUCCESSMSG || $FAILMSG fi + if [ $RUN_OGADMSERVER = "yes" ] && [ $RUN_OGADMAGENT = "yes" ]; then + sleep 5 # Damos tiempo a que ogAdmServer este funcionando + fi if [ $RUN_OGADMAGENT = "yes" ]; then $ACTIONMSG "Iniciando demonio: $AGENTNAME" $DAEMONSTART $AGENTDAEMON $EXTRAOPTS $AGENTDAEMON_OPTIONS $ENDOPTS @@ -200,9 +192,6 @@ para_demonios() { $ACTIONMSG "Parando demonio: $AGENTNAME" $DAEMONSTOP $AGENTNAME [ $? = 0 ] && $SUCCESSMSG || $FAILMSG - $ACTIONMSG "Parando demonio: $REPONAME" - $DAEMONSTOP $REPONAME - [ $? = 0 ] && $SUCCESSMSG || $FAILMSG $ACTIONMSG "Parando demonio: $REPOAUXNAME" pkill faucet [ $? -le 1 ] && $SUCCESSMSG || $FAILMSG diff --git a/admin/WebConsole/asistentes/jscripts/asistentes.js b/admin/WebConsole/asistentes/jscripts/asistentes.js index a7bec7d2..59446868 100644 --- a/admin/WebConsole/asistentes/jscripts/asistentes.js +++ b/admin/WebConsole/asistentes/jscripts/asistentes.js @@ -144,7 +144,7 @@ function codeParticionadoMSDOS (form) { var partCode=""; var logicalCode=""; var sizecacheCode=""; - var cacheCode; + var cacheCode=""; var cacheSize; var extended=false; var n_disk = form.n_disk.value; @@ -203,13 +203,8 @@ function codeParticionadoMSDOS (form) { if (form.size4.value == "0") { sizecacheCode="\ ogEcho session \"[20] $MSG_HELP_ogGetCacheSize\"\n \ -sizecache=`ogGetCacheSize` \n "; +sizecache=`ogGetCacheSize` "; cacheCode="\ -ogEcho session \"[30] $MSG_HELP_ogUpdatePartitionTable "+n_disk+"\"\n \ -ogCreatePartitionTable "+n_disk+" "+tipo_part_table +" \n \ -ogDeletePartitionTable "+n_disk+" \n \ -ogExecAndLog command ogUpdatePartitionTable "+n_disk+" \n \ -ogEcho session \"[50] $MSG_HELP_ogCreateCache\"\n \ initCache "+n_disk+" $sizecache NOMOUNT &>/dev/null \n "; } else { if (form.size4.value == "CUSTOM") { @@ -218,19 +213,11 @@ initCache "+n_disk+" $sizecache NOMOUNT &>/dev/null \n "; cacheSize = form.size4.value; } cacheCode="\ -ogEcho session \"[30] $MSG_HELP_ogUpdatePartitionTable "+n_disk+"\"\n \ -ogCreatePartitionTable "+n_disk+" "+tipo_part_table +" \n \ -ogDeletePartitionTable "+n_disk+" \n \ -ogUpdatePartitionTable "+n_disk+" \n \ -ogEcho session \"[50] $MSG_HELP_ogCreateCache\"\n \ -initCache " + n_disk + " " + cacheSize + " NOMOUNT &>/dev/null"; +initCache " + n_disk + " " + cacheSize + " NOMOUNT &>/dev/null \n "; } + cacheCode += "ogEcho session \"[60] $MSG_HELP_ogListPartitions "+n_disk+"\" \n "; + cacheCode += "ogExecAndLog command session ogListPartitions "+n_disk+" \n "; } else { - cacheCode="\ -ogEcho session \"[30] $MSG_HELP_ogUpdatePartitionTable "+n_disk+"\"\n \ -ogCreatePartitionTable "+n_disk+" "+tipo_part_table +" \n \ -ogDeletePartitionTable "+n_disk+" \n \ -ogUpdatePartitionTable "+n_disk+" \n"; partCode += " EMPTY:0"; } } @@ -276,8 +263,8 @@ partCode += " EMPTY:0"; // Formateo de la partición swap if (swapPart.length > 0) { for (var i=0; i < swapPart.length; i++) { - swapCode += "ogEcho session log \"$MSG_HELP_ogFormat "+n_disk+" "+swapPart[i]+" LINUX-SWAP \" \n " ; - swapCode += "ogExecAndLog command session log ogFormat "+n_disk+" "+swapPart[i]+" LINUX-SWAP \n "; + swapCode += " ogEcho session log \"[95] $MSG_HELP_ogFormat "+n_disk+" "+swapPart[i]+" LINUX-SWAP \"\n " ; + swapCode += " ogExecAndLog command ogFormat "+n_disk+" "+swapPart[i]+" LINUX-SWAP \n "; } } @@ -287,17 +274,19 @@ partCode += " EMPTY:0"; ogEcho session \"[10] $MSG_HELP_ogUnmountAll "+n_disk+"\"\n \ ogUnmountAll "+n_disk+" 2>/dev/null \n \ ogUnmountCache \n \ -" + cacheCode + " \n \ -ogEcho session \"[60] $MSG_HELP_ogListPartitions "+n_disk+"\"\n \ -ogExecAndLog command session ogListPartitions "+n_disk+" \n \ +ogEcho session \"[30] $MSG_HELP_ogUpdatePartitionTable "+n_disk+"\"\n \ +ogCreatePartitionTable "+n_disk+" "+tipo_part_table +" \n \ +ogDeletePartitionTable "+n_disk+" \n \ +ogUpdatePartitionTable "+n_disk+" \n \ +" + cacheCode + "\ ogEcho session \"[70] $MSG_HELP_ogCreatePartitions " + partCode + "\"\n \ -if ogExecAndLog command session ogCreatePartitions "+n_disk+" " + partCode + "; then \n \ +if ogExecAndLog command ogCreatePartitions "+n_disk+" " + partCode + "; then \n \ ogEcho session \"[80] $MSG_HELP_ogSetPartitionActive "+n_disk+" 1\"\n \ ogSetPartitionActive "+n_disk+" 1 \n \ - ogEcho log session \"[100] $MSG_HELP_ogListPartitions "+n_disk+"\"\n \ + ogEcho log session \"[90] $MSG_HELP_ogListPartitions "+n_disk+"\"\n \ ogUpdatePartitionTable "+n_disk+" \n \ ms-sys /dev/sda | grep unknow && ms-sys /dev/sda \n \ - ogExecAndLog command session log ogListPartitions "+n_disk+" \n \ + ogExecAndLog command session log ogListPartitions "+n_disk+" \n\ "+ swapCode +"\ else \n \ ogEcho session log \"[100] ERROR: $MSG_HELP_ogCreatePartitions\" \n \ @@ -329,11 +318,8 @@ function codeParticionadoGPT (form) { if (form.sizeGPT4.value == "0") { sizecacheCode="\ ogEcho session \"[20] $MSG_HELP_ogGetCacheSize\"\n \ -sizecache=`ogGetCacheSize` \n "; +sizecache=`ogGetCacheSize` "; cacheCode="\ -ogEcho session \"[30] $MSG_HELP_ogUpdatePartitionTable "+n_disk+"\"\n \ -ogDeletePartitionTable "+n_disk+" \n \ -ogExecAndLog command ogUpdatePartitionTable "+n_disk+" \n \ ogEcho session \"[50] $MSG_HELP_ogCreateCache\"\n \ initCache "+ n_disk +" $sizecache NOMOUNT &>/dev/null \n "; } else { @@ -343,12 +329,11 @@ initCache "+ n_disk +" $sizecache NOMOUNT &>/dev/null \n "; cacheSize = form.sizeGPT4.value; } cacheCode="\ -ogEcho session \"[30] $MSG_HELP_ogUpdatePartitionTable "+n_disk+"\"\n \ -ogDeletePartitionTable "+n_disk+" \n \ -ogUpdatePartitionTable "+n_disk+" \n \ ogEcho session \"[50] $MSG_HELP_ogCreateCache\"\n \ -initCache " + n_disk +" "+ cacheSize + " NOMOUNT &>/dev/null"; +initCache " + n_disk +" "+ cacheSize + " NOMOUNT &>/dev/null \n "; } + cacheCode += "ogEcho session \"[60] $MSG_HELP_ogListPartitions "+n_disk+"\"\n "; + cacheCode += "ogExecAndLog command session ogListPartitions "+n_disk+" \n "; } else{ var partType=eval("form.partGPT"+nPart); if (partType.value == "CUSTOM" ) { @@ -372,22 +357,14 @@ initCache " + n_disk +" "+ cacheSize + " NOMOUNT &>/dev/null"; } } } else { - if(nPart == 4){ - cacheCode="\ -ogEcho session \"[30] $MSG_HELP_ogUpdatePartitionTable "+n_disk+"\"\n \ -ogDeletePartitionTable "+n_disk+" \n \ -ogUpdatePartitionTable "+n_disk+" \n"; -partCode += " EMPTY:0"; - } else{ - partCode += " EMPTY:0"; - } + partCode += " EMPTY:0"; } } // Formateo de la partición swap if (swapPart.length > 0) { for (var i=0; i < swapPart.length; i++) { - swapCode += " ogEcho session log \"$MSG_HELP_ogFormat "+n_disk+" "+swapPart[i]+" LINUX-SWAP \" \n" ; - swapCode += " ogExecAndLog command session log ogFormat "+n_disk+" "+swapPart[i]+" LINUX-SWAP \n"; + swapCode += " ogEcho session log \"[95] $MSG_HELP_ogFormat "+n_disk+" "+swapPart[i]+" LINUX-SWAP \" \n" ; + swapCode += " ogExecAndLog command ogFormat "+n_disk+" "+swapPart[i]+" LINUX-SWAP \n"; } } @@ -396,16 +373,17 @@ partCode += " EMPTY:0"; ogCreatePartitionTable "+n_disk+" "+tipo_part_table +" \n \ ogEcho log session \"[0] $MSG_HELP_ogCreatePartitions "+n_disk+"\"\n \ ogEcho session \"[10] $MSG_HELP_ogUnmountAll "+n_disk+"\"\n \ -ogUnmountAll "+n_disk+" \n \ +ogUnmountAll "+n_disk+" \n \ ogUnmountCache \n \ -" + cacheCode + " \n \ -ogEcho session \"[60] $MSG_HELP_ogListPartitions "+n_disk+"\"\n \ -ogExecAndLog command session ogListPartitions "+n_disk+" \n \ +ogEcho session \"[30] $MSG_HELP_ogUpdatePartitionTable "+n_disk+"\"\n \ +ogDeletePartitionTable "+n_disk+" \n \ +ogUpdatePartitionTable "+n_disk+" \n \ +" + cacheCode + "\ ogEcho session \"[70] $MSG_HELP_ogCreatePartitions " + partCode + "\"\n \ ogExecAndLog command ogCreatePartitions "+n_disk+" " + partCode + " \n \ ogEcho session \"[80] $MSG_HELP_ogSetPartitionActive "+n_disk+" 1\"\n \ ogSetPartitionActive "+n_disk+" 1 \n \ -ogEcho log session \"[100] $MSG_HELP_ogListPartitions "+n_disk+"\"\n \ +ogEcho log session \"[90] $MSG_HELP_ogListPartitions "+n_disk+"\"\n \ ogUpdatePartitionTable "+n_disk+" \n \ ms-sys /dev/sda | grep unknow && ms-sys /dev/sda \n \ ogExecAndLog command session log ogListPartitions "+n_disk+" \n"; @@ -704,5 +682,3 @@ function checkExtendedPartition(form) { logical.style.visibility="hidden"; } } - - diff --git a/admin/WebConsole/barramenu.php b/admin/WebConsole/barramenu.php index dfb618ed..7584c0d3 100644 --- a/admin/WebConsole/barramenu.php +++ b/admin/WebConsole/barramenu.php @@ -60,7 +60,7 @@ if (!$cmd) var href2="nada.php"; var href3="./api/tree.html"; var href4="./api/main.html"; - var href5="./api/index.html"; + var href5="./principal/ayuda.php"; var device="<?php echo $device;?>"; var version="<?php echo $version;?>"; @@ -160,9 +160,6 @@ if (!$cmd) case 22: opadre.frames["frame_contenidos"].document.location.href=href5; break; - case 23: - opadre.frames["frame_contenidos"].document.location.href="./principal/acercade.php"; - break; } } } @@ -234,12 +231,6 @@ if (!$cmd) <A href="#" style="text-decoration: none"><IMG border=0 src="./images/iconos/ayuda.gif"> <SPAN class=menupral ><?php echo $TbMsg[11] ?></SPAN></A> </TD> <TD width=4 align=middle><IMG src="./images/iconos/separitem.gif"></TD> - - <TD onclick=eleccion(this,23); onmouseout=desresaltar(this); onmouseover=resaltar(this); align=middle> - <A href="#" style="text-decoration: none"><IMG border=0 src="./images/iconos/logocirculos.png"> <SPAN class=menupral ><?php echo $TbMsg[17] ?></SPAN></A> </TD> - <TD width=4 align=middle><IMG src="./images/iconos/separitem.gif"></TD> - - <TD onclick=eleccion(this,21); onmouseout=desresaltar(this); onmouseover=resaltar(this); align=middle> <A href="#" style="text-decoration: none"><IMG border=0 src="./images/iconos/usuarioslog.gif"> <SPAN class=menupral ><?php echo $TbMsg[10] ?></SPAN></A> </TD> <TD width=4 align=middle><IMG src="./images/iconos/separitem.gif"></TD> diff --git a/admin/WebConsole/comandos/CrearImagen.php b/admin/WebConsole/comandos/CrearImagen.php index 37a43128..bab18e16 100644 --- a/admin/WebConsole/comandos/CrearImagen.php +++ b/admin/WebConsole/comandos/CrearImagen.php @@ -7,6 +7,9 @@ // Nombre del fichero: CrearImagen.php // Descripción : // Implementación del comando "CrearImagen.php" +// Version 1.1.1: Si no existe repositorio asignado al ordenador se muestra un mensaje informativo (ticket-870). +// Autora: Irina Gomez, ETSII Universidad de Sevilla +// Fecha: 2018-11-08 // ************************************************************************************************************************************************* include_once("../includes/ctrlacc.php"); include_once("../clases/AdoPhp.php"); @@ -51,12 +54,21 @@ if (!$resul){ echo '<p align=center><span class=cabeceras>'.$TbMsg[0].' </span><br>'; echo '<IMG src="'.$urlimg.'"> <span align=center class=subcabeceras> <U>'.$TbMsg[14].': '.$textambito.','.$nombreambito.'</U></span> </span></p>'; -?> -<P align=center><SPAN align=center class=subcabeceras><?php echo $TbMsg[6] ?></SPAN></P> -<FORM align=center name="fdatos"> - <?php echo tablaConfiguracionesCrearImagen($cmd,$idambito,$idrepositorio); ?> -</FORM> + echo '<P align=center><SPAN align=center class=subcabeceras><?php echo $TbMsg[6] ?></SPAN></P>'."\n"; + + if (tiene_repo($idambito)) { + echo '<FORM align=center name="fdatos">'."\n". + tablaConfiguracionesCrearImagen($cmd,$idambito,$idrepositorio). + '</FORM>'."\n"; + + } else { + echo '<TABLE align=center border=0 cellPadding=1 cellSpacing=1 class=tabla_datos>'."\n". + ' <TR>'."\n". + ' <TH align=center>'.$TbMsg["CREATE_NOREPO"].'</TH>'."\n". + ' </TR>'."\n". + '</TABLE>'."\n"; + } ?> <?php //________________________________________________________________________________________________________ @@ -132,4 +144,28 @@ function HTMLSELECT_imagenes($cmd,$idrepositorio,$idperfilsoft,$disk,$particion, $SelectHtml.= '</SELECT>'; return($SelectHtml); } + +//____________________________________________________________________________________________________ +// Devuelve si tiene repositorio asignado o no (true o false) +// Param: +// - idordenador: identificador del ordenador +//____________________________________________________________________________________________________ +function tiene_repo ($idordenador) { + global $cmd; + + $idrepositorio = 0; + $rs=new Recordset; + $cmd->texto="SELECT idrepositorio from ordenadores WHERE idordenador=$idordenador"; + $rs->Comando=&$cmd; + if ($rs->Abrir()) { + $rs->Primero(); + $idrepositorio = $rs->campos["idrepositorio"]; + } + $rs->Cerrar(); + if ($idrepositorio == 0) { + return false; + } else { + return true; + } +} ?> diff --git a/admin/WebConsole/controlpostacceso.php b/admin/WebConsole/controlpostacceso.php index 844f33ca..01f840d2 100644 --- a/admin/WebConsole/controlpostacceso.php +++ b/admin/WebConsole/controlpostacceso.php @@ -168,6 +168,31 @@ if ($idc != 0) return(true); } //_______________________________________________________________________________________________________ + // Muestra mensaje de alerta si no existe repositorio en la unidad organizativa + // Parametros: + // - cmd:Una comando ya operativo (con conexión abierta) + // - idcentro: identificador de la unidad organizativa + //_______________________________________________________________________________________________________ + function alert_norepo($cmd, $idcentro,$mensaje){ + // Si entramos en la parte administrativo no se muestra mensaje + if ($idcentro == 0) return; + + $idrepositorio = ''; + $rs=new Recordset; + $cmd->texto="SELECT idrepositorio FROM repositorios ". + " WHERE idcentro=$idcentro LIMIT 1;"; + $rs->Comando=&$cmd; + if ($rs->Abrir()) { + $rs->Primero(); + $idrepositorio = $rs->campos["idrepositorio"]; + } + $rs->Cerrar(); + if ($idrepositorio == '') { + echo 'alert("'.$mensaje.'");'; + } + return; + + } ?> <html> <head> @@ -183,6 +208,7 @@ if ($idc != 0) <script language="javascript"> var vez=0; setTimeout("acceso();",300); + function acceso(){ o=document.getElementById("mensaje"); var s=o.style.visibility; @@ -197,7 +223,7 @@ if ($idc != 0) vez++; setTimeout("acceso();",300); } + <?php alert_norepo($cmd, $idc,$TbMsg["WARN_NOREPO"]) ?>; </script> </body> </html> - diff --git a/admin/WebConsole/estilos.css b/admin/WebConsole/estilos.css index 4b37be1f..d80d00fe 100644 --- a/admin/WebConsole/estilos.css +++ b/admin/WebConsole/estilos.css @@ -431,4 +431,10 @@ A.tabla_listados_sin:link{ FONT-SIZE: 14px; FONT-WEIGHT: 300; } - +/* Ayuda enlaces sin subrayado */ +.help_menu +{ + text-decoration: none; + color: #6b6363; + font-weight: bold; +} diff --git a/admin/WebConsole/gestores/gestor_ordenadores.php b/admin/WebConsole/gestores/gestor_ordenadores.php index d2b74482..2b517abd 100644 --- a/admin/WebConsole/gestores/gestor_ordenadores.php +++ b/admin/WebConsole/gestores/gestor_ordenadores.php @@ -165,6 +165,15 @@ if($opcion!=$op_movida){ echo '</BODY> '; echo '</HTML>'; } +?> +<script> + // Capturar el iframe donde se muestra el arbol de aulas, + // Al estar dentro del iframe de contenido, debemos acceder al padre y desde ahi acceder al iframe del arbol para recargarlo + var iframe = this.parent.document.getElementsByName("frame_arbol")[0]; + // recargar iframe + iframe.src = iframe.src; +</script> +<?php /************************************************************************************************************************************************** Busca identificador del aula de un grupo de ordenador .Devuelve el identificador del aula a la que pertenece el grupo Parametros: diff --git a/admin/WebConsole/gestores/gestor_repositorios.php b/admin/WebConsole/gestores/gestor_repositorios.php index 7008d6d5..0d3af636 100644 --- a/admin/WebConsole/gestores/gestor_repositorios.php +++ b/admin/WebConsole/gestores/gestor_repositorios.php @@ -23,10 +23,8 @@ $opcion=0; // Inicializa parametros $idrepositorio=0; $nombrerepositorio=""; $ip=""; -$passguor=""; $grupoid=0; -$puertorepo=""; $apiKeyRepo=""; $comentarios=""; @@ -38,8 +36,6 @@ if (isset($_POST["identificador"])) $idrepositorio=$_POST["identificador"]; if (isset($_POST["nombrerepositorio"])) $nombrerepositorio=$_POST["nombrerepositorio"]; if (isset($_POST["ip"])) $ip=$_POST["ip"]; -if (isset($_POST["passguor"])) $passguor=$_POST["passguor"]; -if (isset($_POST["puertorepo"])) $puertorepo=$_POST["puertorepo"]; if (isset($_POST["apiKeyRepo"])) $apiKeyRepo=$_POST["apiKeyRepo"]; if (isset($_POST["comentarios"])) $comentarios=$_POST["comentarios"]; @@ -110,8 +106,6 @@ function Gestiona(){ global $idrepositorio; global $nombrerepositorio; global $ip; - global $passguor; - global $puertorepo; global $apiKeyRepo; global $comentarios; @@ -128,14 +122,12 @@ function Gestiona(){ $cmd->CreaParametro("@idrepositorio",$idrepositorio,1); $cmd->CreaParametro("@nombrerepositorio",$nombrerepositorio,0); $cmd->CreaParametro("@ip",$ip,0); - $cmd->CreaParametro("@passguor",$passguor,0); - $cmd->CreaParametro("@puertorepo",$puertorepo,0); $cmd->CreaParametro("@apiKeyRepo",$apiKeyRepo,0); $cmd->CreaParametro("@comentarios",$comentarios,0); switch($opcion){ case $op_alta : - $cmd->texto="INSERT INTO repositorios(idcentro,grupoid,nombrerepositorio,ip,passguor,puertorepo,comentarios,apikey) VALUES (@idcentro,@grupoid,@nombrerepositorio,@ip,@passguor,@puertorepo,@comentarios,@apiKeyRepo)"; + $cmd->texto="INSERT INTO repositorios(idcentro,grupoid,nombrerepositorio,ip,comentarios,apikey) VALUES (@idcentro,@grupoid,@nombrerepositorio,@ip,@comentarios,@apiKeyRepo)"; $resul=$cmd->Ejecutar(); if ($resul){ // Crea una tabla nodo para devolver a la p�gina que llam� �sta $idrepositorio=$cmd->Autonumerico(); @@ -147,7 +139,7 @@ function Gestiona(){ } break; case $op_modificacion: - $cmd->texto="UPDATE repositorios SET nombrerepositorio=@nombrerepositorio,ip=@ip,passguor=@passguor,puertorepo=@puertorepo,comentarios=@comentarios, apikey=@apiKeyRepo WHERE idrepositorio=@idrepositorio"; + $cmd->texto="UPDATE repositorios SET nombrerepositorio=@nombrerepositorio,ip=@ip,comentarios=@comentarios, apikey=@apiKeyRepo WHERE idrepositorio=@idrepositorio"; $resul=$cmd->Ejecutar(); if ($resul) { updateBootRepo($cmd, $idrepositorio); @@ -180,4 +172,3 @@ function SubarbolXML_repositorios($idrepositorio,$nombrerepositorio){ $cadenaXML.='</REPOSITORIO>'; return($cadenaXML); } -?> diff --git a/admin/WebConsole/idiomas/javascripts/cat/avisos_cat.js b/admin/WebConsole/idiomas/javascripts/cat/avisos_cat.js new file mode 100644 index 00000000..c4f8d01d --- /dev/null +++ b/admin/WebConsole/idiomas/javascripts/cat/avisos_cat.js @@ -0,0 +1,7 @@ +//____________________________________________________________________________ +// +// Fichero de idiomas javascript: avisos_cat.js +// Idioma: Catalán +//____________________________________________________________________________ +TbMsg=new Array; +TbMsg["WARN_NOREPO"]="No hay definido repositorio en la unidad organizativa, los ordenadores se darán de alta sin repositorio."; diff --git a/admin/WebConsole/idiomas/javascripts/cat/propiedades_repositorios_cat.js b/admin/WebConsole/idiomas/javascripts/cat/propiedades_repositorios_cat.js index 547d7e6b..7cf306b3 100644 --- a/admin/WebConsole/idiomas/javascripts/cat/propiedades_repositorios_cat.js +++ b/admin/WebConsole/idiomas/javascripts/cat/propiedades_repositorios_cat.js @@ -6,6 +6,6 @@ TbMsg=new Array; TbMsg[0]="El nombre del repositorio sólo puede contener caracteres alfanuméricos"; TbMsg[1]="Debe introducir una dirección IP"; -TbMsg[2]="ATENCIÓN: Hay imágenes alojadas por este repositorio. ¿Está seguro de querer eliminarlo ?"; +TbMsg[2]="ATENCIÓN: Hay ordenadores con este repositorio asignado. ¿Está seguro de querer eliminarlo ?"; TbMsg[3]="Debe introducir un puerto de comunicaciones para los clientes"; TbMsg[4]="Los comentarios sólo pueden contener caracteres alfanuméricos"; diff --git a/admin/WebConsole/idiomas/javascripts/eng/acciones_eng.js b/admin/WebConsole/idiomas/javascripts/eng/acciones_eng.js index 3e230582..f1fa153f 100644 --- a/admin/WebConsole/idiomas/javascripts/eng/acciones_eng.js +++ b/admin/WebConsole/idiomas/javascripts/eng/acciones_eng.js @@ -1,10 +1,10 @@ //____________________________________________________________________________ // -// Fichero de idiomas javascript: acciones_eng.js -// Idioma: Ings +// Javascript language file: acciones_eng.js +// Language: English //____________________________________________________________________________ TbMsg=new Array; -TbMsg[0]="WARNING.- This task will be performed. Are you sure ?"; -TbMsg[1]="WARNING.- This job will be performed. Are you sure ?"; -TbMsg[2]="This task has been successfully initiated"; -TbMsg[3]="This job has been successfully initiated"; +TbMsg[0]="WARNING.- This task will be executed. Are you sure?"; +TbMsg[1]="WARNING.- This job will be executed. Are you sure?"; +TbMsg[2]="This task has been executed successfully "; +TbMsg[3]="This job has been executed successfully"; diff --git a/admin/WebConsole/idiomas/javascripts/eng/accionmenu_eng.js b/admin/WebConsole/idiomas/javascripts/eng/accionmenu_eng.js index 51d2550d..e190705f 100644 --- a/admin/WebConsole/idiomas/javascripts/eng/accionmenu_eng.js +++ b/admin/WebConsole/idiomas/javascripts/eng/accionmenu_eng.js @@ -1,13 +1,11 @@ //________________________________________________________________________________________________________ // -// Fichero de idiomas javascript: accionmenu_eng.js -// Idioma: Ings -//________________________________________________________________________________________________________ +// Javascript language file: accionmenu_eng.js +// Language: English +//____________________________________________________________________________ TbMsg=new Array; -TbMsg[0]="WARNING: You must introduce an item description"; -TbMsg[1]="WARNING: You must introduce an order number"; -TbMsg[2]="This item has been successfully included in this menu"; -TbMsg[3]="This item has been successfully excluded from this menu"; -TbMsg[4]="This item has been successfully modified"; - - +TbMsg[0]="WARNING: You must enter an item description"; +TbMsg[1]="WARNING: You must enter an order number"; +TbMsg[2]="This item has been included successfully in this menu"; +TbMsg[3]="This item has been excluded successfully from this menu"; +TbMsg[4]="This item has been modified successfully"; diff --git a/admin/WebConsole/idiomas/javascripts/eng/administradores_centros_eng.js b/admin/WebConsole/idiomas/javascripts/eng/administradores_centros_eng.js index 5271887d..225a7897 100644 --- a/admin/WebConsole/idiomas/javascripts/eng/administradores_centros_eng.js +++ b/admin/WebConsole/idiomas/javascripts/eng/administradores_centros_eng.js @@ -1,8 +1,8 @@ //____________________________________________________________________________ // -// Fichero de idiomas javascript: administradores_centros_eng.js -// Idioma: Ingles +// Javascript language file: administradores_centros_eng.js +// Language: English //____________________________________________________________________________ TbMsg=new Array; -TbMsg[0]="The Administrator has been included in this Organizational Unit correctly"; -TbMsg[1]="This Administrator has properly been excluded from this Organizational Unit"; +TbMsg[0]="This Administrator has been included successfully in this Organizational Unit"; +TbMsg[1]="This Administrator has been excluded successfully from this Organizational Unit"; diff --git a/admin/WebConsole/idiomas/javascripts/eng/administradores_usuarios_eng.js b/admin/WebConsole/idiomas/javascripts/eng/administradores_usuarios_eng.js index 793df1b7..c979eb1d 100644 --- a/admin/WebConsole/idiomas/javascripts/eng/administradores_usuarios_eng.js +++ b/admin/WebConsole/idiomas/javascripts/eng/administradores_usuarios_eng.js @@ -1,8 +1,8 @@ //____________________________________________________________________________ // -// Fichero de idiomas javascript: administradores_usuarios_eng.js -// Idioma: Ingles +// Javascript language file: administradores_usuarios_eng.js +// Language: English //____________________________________________________________________________ TbMsg=new Array; -TbMsg[0]="The Organizational Unit has been properly assigned to User"; -TbMsg[1]="The Organizational Unit has been properly excluded from this User"; +TbMsg[0]="The Organizational Unit has been assigned successfully to this User"; +TbMsg[1]="The Organizational Unit has been excluded successfully from this User"; diff --git a/admin/WebConsole/idiomas/javascripts/eng/asistentes_eng.js b/admin/WebConsole/idiomas/javascripts/eng/asistentes_eng.js index c6bcd421..01753ce3 100644 --- a/admin/WebConsole/idiomas/javascripts/eng/asistentes_eng.js +++ b/admin/WebConsole/idiomas/javascripts/eng/asistentes_eng.js @@ -1,10 +1,10 @@ //________________________________________________________________________________________________________ // -// Fichero de idiomas javascript: asistentes.js -// Idioma: Inglés -//________________________________________________________________________________________________________ +// Javascript language file: asistentes.js +// Language: English +//____________________________________________________________________________ TbMsg=new Array; // Asistente de particionado -TbMsg["NOCACHESIZE"] = "¡El espacio libre en disco es menor que la cache!"; -TbMsg["NODISKSIZE"] = "¡El espacio libre en disco no puede ser menor que 0!"; -TbMsg["NOSUPPORT"] = "Este navegador no soporta la operación."; +TbMsg["NOCACHESIZE"] = "Free disk space is smaller than cache!"; +TbMsg["NODISKSIZE"] = "Free disk space cannot be lower than zero!"; +TbMsg["NOSUPPORT"] = "This browser does not support this operation."; diff --git a/admin/WebConsole/idiomas/javascripts/eng/aulas_eng.js b/admin/WebConsole/idiomas/javascripts/eng/aulas_eng.js index 1b45152b..56bf01e0 100644 --- a/admin/WebConsole/idiomas/javascripts/eng/aulas_eng.js +++ b/admin/WebConsole/idiomas/javascripts/eng/aulas_eng.js @@ -1,21 +1,21 @@ //________________________________________________________________________________________________________ // -// Fichero de idiomas javascript: aulas_eng.js -// Idioma: Ings -//________________________________________________________________________________________________________ +// Javascript language file: aulas_eng.js +// Language: English +//____________________________________________________________________________ TbMsg=new Array; -TbMsg[0]="Computer template have been successfully registered and all the computers of this lab have been updated using this configuration"; -TbMsg[1]="WARNING: This environment will be refresh. Are you sure ?"; -TbMsg[2]="WARNING: This environment will be purge. Are you sure ?"; -TbMsg[3]="WARNING: The items of menus from this environment will be refresh. Are you sure ?"; -TbMsg[4]="WARNING: This environment will be switched: Are you sure?"; -TbMsg[5]="WARNING: Remote Console is already enabled for this environment. Follow up on the screen of Commands / Scripts"; -TbMsg[6]="WARNING: You must select the 'Remote Console' previously"; -TbMsg[7]="The update request is send with success"; -TbMsg[8]="There is something wrong with the requested update"; -TbMsg[9]="The switch request is send with success"; -TbMsg[10]="There is something wrong with the requested switch"; -TbMsg[11]="The scan request is send with success"; -TbMsg[12]="There is something wrong with requested scan"; +TbMsg[0]="Computer template have been registered successfully and all the computers in this lab have been updated using this template"; +TbMsg[1]="WARNING: This scope will be refreshed. Are you sure?"; +TbMsg[2]="WARNING: This scope will be purged. Are you sure?"; +TbMsg[3]="WARNING: The menu items from this scope will be refreshed. Are you sure?"; +TbMsg[4]="WARNING: This scope will be switched. Are you sure?"; +TbMsg[5]="WARNING: Remote Console is already enabled for this scope. Follow up on the Commands/Scripts screen"; +TbMsg[6]="WARNING: You must select previously 'Remote Console'"; +TbMsg[7]="Update request has been sent successfully"; +TbMsg[8]="Error requesting updating"; +TbMsg[9]="Switch request has been sent successfully"; +TbMsg[10]="Error requesting switching"; +TbMsg[11]="Scan request has been sent successfully"; +TbMsg[12]="Error requesting scanning"; diff --git a/admin/WebConsole/idiomas/javascripts/eng/avisos_eng.js b/admin/WebConsole/idiomas/javascripts/eng/avisos_eng.js new file mode 100644 index 00000000..3dc1c0c9 --- /dev/null +++ b/admin/WebConsole/idiomas/javascripts/eng/avisos_eng.js @@ -0,0 +1,7 @@ +//____________________________________________________________________________ +// +// Fichero de idiomas javascript: avisos_eng.js +// Idioma: Inglés +//____________________________________________________________________________ +TbMsg=new Array; +TbMsg["WARN_NOREPO"]="There is no defined repository in the organizational unit, the computers will be registered without a repository."; diff --git a/admin/WebConsole/idiomas/javascripts/eng/colasacciones_eng.js b/admin/WebConsole/idiomas/javascripts/eng/colasacciones_eng.js index d9865e7d..ef967559 100644 --- a/admin/WebConsole/idiomas/javascripts/eng/colasacciones_eng.js +++ b/admin/WebConsole/idiomas/javascripts/eng/colasacciones_eng.js @@ -1,28 +1,28 @@ //________________________________________________________________________________________________________ // -// Fichero de idiomas javascript: colasacciones_eng.js -// Idioma: Ings -//________________________________________________________________________________________________________ +// Javascript language file: colasacciones_eng.js +// Language: English +//____________________________________________________________________________ TbMsg=new Array; -TbMsg[0]="WARNING: This action has finished in a way automatically and you can't change its final result manually"; -TbMsg[1]="WARNING: This action has finished and you can't change its status"; -TbMsg[2]="WARNING: This action has already finished in a way manually"; +TbMsg[0]="WARNING: This action has finished automatically and final result cannot be changed manually"; +TbMsg[1]="WARNING: This action has finished and status cannot be changed"; +TbMsg[2]="WARNING: This action has already finished manually"; TbMsg[3]="WARNING: This action has already been canceled"; -TbMsg[4]="WARNING: This action is already initiated"; +TbMsg[4]="WARNING: This action is already started"; TbMsg[5]="WARNING: This action is already stopped "; -TbMsg[6]="WARNING: This action has already been removed"; +TbMsg[6]="WARNING: This action has already been deleted"; -TbMsg[7]="WARNING: The final result of this action has been successfully modified "; -TbMsg[8]="WARNING: The status of this action has been successfully modified "; -TbMsg[9]="WARNING: This action has been successfully reinitialized"; -TbMsg[10]="WARNING: This action has been successfully removed"; +TbMsg[7]="WARNING: The final result of this action has been modified successfully "; +TbMsg[8]="WARNING: The status of this action has been modified successfully "; +TbMsg[9]="WARNING: This action has been reinitialized successfully"; +TbMsg[10]="WARNING: This action has been deleted successfully"; TbMsg[11]="WARNING: This action has finished successfully "; -TbMsg[12]="WARNING: This notification has already been removed or reinitialized"; +TbMsg[12]="WARNING: This notification has already been deleted or reinitialized"; TbMsg[13]="WARNING: This notification has already been reinitialized"; -TbMsg[14]="WARNING: It's already been successfully notified."; -TbMsg[15]="WARNING: It's already been unsuccessfully notified."; +TbMsg[14]="WARNING: It has already been notified successfully."; +TbMsg[15]="WARNING: It has already been notified unsuccessfully."; -TbMsg[16]="WARNING: The result of this notification has been successfully modified "; -TbMsg[17]="WARNING: This notification has been successfully reinitialized"; +TbMsg[16]="WARNING: The result of this notification has been modified successfully"; +TbMsg[17]="WARNING: This notification has been reinitialized successfully"; diff --git a/admin/WebConsole/idiomas/javascripts/eng/comandos/comunescomandos_eng.js b/admin/WebConsole/idiomas/javascripts/eng/comandos/comunescomandos_eng.js index 3f13b558..0f81bee4 100644 --- a/admin/WebConsole/idiomas/javascripts/eng/comandos/comunescomandos_eng.js +++ b/admin/WebConsole/idiomas/javascripts/eng/comandos/comunescomandos_eng.js @@ -1,25 +1,24 @@ //________________________________________________________________________________________________________ // -// Fichero de idiomas javascripts: comunescomandos_eng.js (Común a todos los comandos) -// Idioma: Inglés +// Javascript language file: comunescomandos_eng.js +// Language: English //________________________________________________________________________________________________________ var CTbMsg=new Array; -CTbMsg[0]="WARNING.- Cancelled operation, you will might come back this screen in another moment to perform this command"; -CTbMsg[1]="WARNING: An error occurs when attempt to register command"; -CTbMsg[2]="The command has been successfully registered"; -CTbMsg[3]="WARNING: An error occurred while trying to register this Command as a Procedure"; -CTbMsg[4]="The command has been successfully registered as a Procedure"; -CTbMsg[5]="WARNING: An error occurred while trying to register this Command as a Task"; -CTbMsg[6]="The command has been successfully registered as a Task"; -CTbMsg[7]="WARNING: An error occurs when attempt to register command"; - -CTbMsg[8]="WARNING: Choose one mode of execution at least"; -CTbMsg[9]="WARNING: You must choose a way of immediate execution"; -CTbMsg[10]="WARNING: You must choose a way of inclusion this command on procedure"; -CTbMsg[11]="WARNING: You must specify the name of the new procedure where this command will be added"; -CTbMsg[12]="WARNING: You should choose the procedure that will add this command"; -CTbMsg[13]="WARNING: You must choose a way of inclusion this command on task executable"; -CTbMsg[14]="WARNING: You must specify the name of the new task where this command will be added"; -CTbMsg[15]="WARNING: You must choose the task that will add this command"; -CTbMsg[16]="AVISO: si el código incluye reinicio o apagado, puede provocar que el cliente no inicie correctamente"; -CTbMsg[17]="The command has been successfully registered, but there was some problems connecting repository REST API"; +CTbMsg[0]="WARNING: Canceled operation, you can return at any time on this screen to execute this command again"; +CTbMsg[1]="WARNING: Error sending this command"; +CTbMsg[2]="Command has been sent successfully"; +CTbMsg[3]="WARNING: Error registering this Command as a Procedure"; +CTbMsg[4]="The command has been registered successfully as a Procedure"; +CTbMsg[5]="WARNING: Error registering this Command as a Task"; +CTbMsg[6]="Command has been registered successfully as a Task"; +CTbMsg[7]="WARNING: Error trying to register command action"; +CTbMsg[8]="WARNING: You must choose at least one execution mode"; +CTbMsg[9]="WARNING: You must choose one immediate execution mode"; +CTbMsg[10]="WARNING: You must choose a way of including this command into a Procedure"; +CTbMsg[11]="WARNING: You must specify a name for the new procedure where this command will be added."; +CTbMsg[12]="WARNING: You must choose the procedure where this command will be added"; +CTbMsg[13]="WARNING: You must choose a way of including this command into an executable task"; +CTbMsg[14]="WARNING: You must specify a name for the new task where this command will be added"; +CTbMsg[15]="WARNING: You must choose the task where this command will be added"; +CTbMsg[16]="WARNING: If the code contains reboot or shutdown, the client might not boot successfully"; +CTbMsg[17]="Command has been sent successfully, but there was some problems connecting API REST Repository"; diff --git a/admin/WebConsole/idiomas/javascripts/eng/comandos/configurar_eng.js b/admin/WebConsole/idiomas/javascripts/eng/comandos/configurar_eng.js index abc99019..38eef74f 100644 --- a/admin/WebConsole/idiomas/javascripts/eng/comandos/configurar_eng.js +++ b/admin/WebConsole/idiomas/javascripts/eng/comandos/configurar_eng.js @@ -1,16 +1,16 @@ //________________________________________________________________________________________________________ // -// Fichero de idiomas javascripts: configurar_eng.js -// Idioma: Ings +// Javascript language file: configurar_eng.js +// Language: English //________________________________________________________________________________________________________ TbMsg=new Array; -TbMsg[0]="WARNING.- There are partitions with the same number, you must select another or remove it clicking in the last column"; -TbMsg[1]="WARNING.- The number of the partition must be greater than zero"; -TbMsg[2]="El tipo de particin no se ha especificado"; -TbMsg[3]="WARNING.- The size of the partition must be greater than zero"; -TbMsg[4]="ATENCION: Se va a eliminar esta particin Esta seguro ?"; -TbMsg[5]="Debe especificar el tipo de sistema de ficheros si desea formatear la particion"; -TbMsg[6]="La CACHE solo puede definirse en la particion 4"; -TbMsg[7]="El nmero maximo de particiones es 4"; -TbMsg["EXTSIZE"]="El tamao de las particiones lgicas es mayor que el de la particin extendida"; -TbMsg["HDSIZE"]="El tamao de las particiones es mayor el tamao del disco"; +TbMsg[0]="WARNING: Duplicated partition. There is another partition with the same number. Please, select another one or delete it by clicking in the last column"; +TbMsg[1]="WARNING: Partition number must be greater than zero"; +TbMsg[2]="Partition type not specified"; +TbMsg[3]="WARNING: Partition size must be greater than zero"; +TbMsg[4]="WARNING: This partition will be deleted. Are you sure?"; +TbMsg[5]="If you want to format this partition, you must specify file-system type"; +TbMsg[6]="CACHE can only be at partition 4"; +TbMsg[7]="Maximum number of partitions is 4"; +TbMsg["EXTSIZE"]="Logic partitions size is greater than extended partition size"; +TbMsg["HDSIZE"]="Partitions size is greater than disk size"; diff --git a/admin/WebConsole/idiomas/javascripts/eng/comandos/crearimagen_eng.js b/admin/WebConsole/idiomas/javascripts/eng/comandos/crearimagen_eng.js index 6525d89b..07701edf 100644 --- a/admin/WebConsole/idiomas/javascripts/eng/comandos/crearimagen_eng.js +++ b/admin/WebConsole/idiomas/javascripts/eng/comandos/crearimagen_eng.js @@ -1,8 +1,8 @@ //________________________________________________________________________________________________________ // -// Fichero de idiomas javascripts: crearperfilsoftware_eng.js -// Idioma: Español +// Javascript language file: crearimagen_eng.js +// Language: English //________________________________________________________________________________________________________ TbMsg=new Array; -TbMsg[0]="You must choose a image for this partition"; -TbMsg[1]="You must choose at least one partition and an image"; +TbMsg[0]="You must choose an image for this partition"; +TbMsg[1]="You must choose at least one partition and one image"; diff --git a/admin/WebConsole/idiomas/javascripts/eng/comandos/crearimagenbasica_eng.js b/admin/WebConsole/idiomas/javascripts/eng/comandos/crearimagenbasica_eng.js index 99465fbf..2b6a9fa8 100644 --- a/admin/WebConsole/idiomas/javascripts/eng/comandos/crearimagenbasica_eng.js +++ b/admin/WebConsole/idiomas/javascripts/eng/comandos/crearimagenbasica_eng.js @@ -1,10 +1,10 @@ //________________________________________________________________________________________________________ // -// Fichero de idiomas javascripts: crearimagenbasica_esp.js -// Idioma: Español +// Javascript language file: crearimagenbasica_eng.js +// Language: English //________________________________________________________________________________________________________ TbMsg=new Array; TbMsg[0]=""; -TbMsg[1]="Debe elegir una imagen para esta partición"; -TbMsg[2]="No ha seleccionado ninguna partición"; -TbMsg[3]="No ha seleccionado ningún método de sincronización"; +TbMsg[1]="You must choose an image for this partition"; +TbMsg[2]="No partition selected"; +TbMsg[3]="No synchronization method selected"; diff --git a/admin/WebConsole/idiomas/javascripts/eng/comandos/crearperfilsoftware_eng.js b/admin/WebConsole/idiomas/javascripts/eng/comandos/crearperfilsoftware_eng.js index dbf1484a..343e7854 100644 --- a/admin/WebConsole/idiomas/javascripts/eng/comandos/crearperfilsoftware_eng.js +++ b/admin/WebConsole/idiomas/javascripts/eng/comandos/crearperfilsoftware_eng.js @@ -1,7 +1,7 @@ //________________________________________________________________________________________________________ // -// Fichero de idiomas javascripts: crearperfilsoftware_eng.js -// Idioma: Ings +// Javascript language file: crearperfilsoftware_eng.js +// Language: English //________________________________________________________________________________________________________ TbMsg=new Array; TbMsg[0]="You must select a software profile for this partition"; diff --git a/admin/WebConsole/idiomas/javascripts/eng/comandos/crearsoftincremental_eng.js b/admin/WebConsole/idiomas/javascripts/eng/comandos/crearsoftincremental_eng.js index 675b5419..25d8932c 100644 --- a/admin/WebConsole/idiomas/javascripts/eng/comandos/crearsoftincremental_eng.js +++ b/admin/WebConsole/idiomas/javascripts/eng/comandos/crearsoftincremental_eng.js @@ -1,8 +1,11 @@ //________________________________________________________________________________________________________ // -// Fichero de idiomas javascripts: crearsoftincremental_eng.js -// Idioma: Ings +// Javascript language file: crearsoftincremental_eng.js +// Language: English //________________________________________________________________________________________________________ TbMsg=new Array; -TbMsg[0]="You must select a diferential software for this partition"; -TbMsg[1]="You must select at least a partition and a diferential software"; +TbMsg[0]=""; +TbMsg[1]="You must choose a basic image for this partition"; +TbMsg[2]="No partition selected"; +TbMsg[3]="You must choose an incremental image for this partition"; +TbMsg[4]="No synchronization method selected"; diff --git a/admin/WebConsole/idiomas/javascripts/eng/comandos/ejecutarscripts_eng.js b/admin/WebConsole/idiomas/javascripts/eng/comandos/ejecutarscripts_eng.js index 577b52c8..05221224 100644 --- a/admin/WebConsole/idiomas/javascripts/eng/comandos/ejecutarscripts_eng.js +++ b/admin/WebConsole/idiomas/javascripts/eng/comandos/ejecutarscripts_eng.js @@ -1,11 +1,11 @@ //________________________________________________________________________________________________________ // -// Fichero de idiomas javascripts: ejecutarscripts_eng.js -// Idioma: Ings +// Javascript language file: ejecutarscripts_eng.js +// Language: English //________________________________________________________________________________________________________ TbMsg=new Array; -TbMsg[0]="WARNING.- Bash code will be performed Are you sure ?"; -TbMsg[1]="You must introduce some code lines or at least a file with Bash code"; -TbMsg[2]="You must introduce the title of the script whether you want to follow-up the accion or to save it like a procedure or task"; -TbMsg[3]="You must introduce the description of the script whether you want to follow-up the accion or to save it like a procedure or task"; -TbMsg[4]="\t!!!!! WARNING !!!!! \nYou have selected unicast to multiple computers,\nThe transfer may be delayed in time";
\ No newline at end of file +TbMsg[0]="WARNING.- Bash code will be executed. Are you sure?"; +TbMsg[1]="You must enter some code lines or at least a file with Bash code"; +TbMsg[2]="You must enter the title of the script whether to follow-up the action or save it as a procedure or task."; +TbMsg[3]="You must enter a description for the script whether to follow-up the action or to save it as a procedure or task"; +TbMsg[4]="\t!!!!! WARNING !!!!! \nYou have selected UNICAST for multiple computers,\nThe transfer may be delayed in time"; diff --git a/admin/WebConsole/idiomas/javascripts/eng/comandos/eliminarimagencache_eng.js b/admin/WebConsole/idiomas/javascripts/eng/comandos/eliminarimagencache_eng.js index e52857b0..237e8771 100644 --- a/admin/WebConsole/idiomas/javascripts/eng/comandos/eliminarimagencache_eng.js +++ b/admin/WebConsole/idiomas/javascripts/eng/comandos/eliminarimagencache_eng.js @@ -1,7 +1,7 @@ //________________________________________________________________________________________________________ // -// Fichero de idiomas javascripts: eliminarimagencache_eng.js -// Idioma: Ingles +// Javascript language file: eliminarimagencache_eng.js +// Language: English //________________________________________________________________________________________________________ TbMsg=new Array; TbMsg[0]=""; diff --git a/admin/WebConsole/idiomas/javascripts/eng/comandos/enviarmensaje_eng.js b/admin/WebConsole/idiomas/javascripts/eng/comandos/enviarmensaje_eng.js index 19d2316a..992120b2 100644 --- a/admin/WebConsole/idiomas/javascripts/eng/comandos/enviarmensaje_eng.js +++ b/admin/WebConsole/idiomas/javascripts/eng/comandos/enviarmensaje_eng.js @@ -1,9 +1,9 @@ //________________________________________________________________________________________________________ // -// Fichero de idiomas javascripts: enviarmensaje_eng.js -// Idioma: Ingls +// Javascript language file: enviarmensaje_eng.js +// Language: English //________________________________________________________________________________________________________ TbMsg=new Array; TbMsg[0]=""; -TbMsg[1]="El mensaje debe tener un ttulo."; -TbMsg[2]="El mensaje debe tener algn contenido."; +TbMsg[1]="The message needs a title."; +TbMsg[2]="The message cannot be empty."; diff --git a/admin/WebConsole/idiomas/javascripts/eng/comandos/iniciarsesion_eng.js b/admin/WebConsole/idiomas/javascripts/eng/comandos/iniciarsesion_eng.js index 86cd4cb3..d8658434 100644 --- a/admin/WebConsole/idiomas/javascripts/eng/comandos/iniciarsesion_eng.js +++ b/admin/WebConsole/idiomas/javascripts/eng/comandos/iniciarsesion_eng.js @@ -1,9 +1,9 @@ //________________________________________________________________________________________________________ // -// Fichero de idiomas javascripts: iniciarsesion_eng.js -// Idioma: Ingles +// Javascript language file: iniciarsesion_eng.js +// Language: English //________________________________________________________________________________________________________ TbMsg=new Array; TbMsg[0]=""; TbMsg[1]="You must choose at least one partition"; -TbMsg["FILTER"]="Debe seleccionar al menos un ordenador que tenga la configuración elegida."; +TbMsg["FILTER"]="You must select at least one computer with the chosen configuration."; diff --git a/admin/WebConsole/idiomas/javascripts/eng/comandos/inventariosoftware_eng.js b/admin/WebConsole/idiomas/javascripts/eng/comandos/inventariosoftware_eng.js index faf6091e..8da24d42 100644 --- a/admin/WebConsole/idiomas/javascripts/eng/comandos/inventariosoftware_eng.js +++ b/admin/WebConsole/idiomas/javascripts/eng/comandos/inventariosoftware_eng.js @@ -1,7 +1,7 @@ //________________________________________________________________________________________________________ // -// Fichero de idiomas javascripts: iniciarsesion_eng.js -// Idioma: English +// Javascript language file: inventariosoftware_eng.js +// Language: English //________________________________________________________________________________________________________ TbMsg=new Array; TbMsg[0]=""; diff --git a/admin/WebConsole/idiomas/javascripts/eng/comandos/particionaryformatear_eng.js b/admin/WebConsole/idiomas/javascripts/eng/comandos/particionaryformatear_eng.js index 6598e659..424206f4 100644 --- a/admin/WebConsole/idiomas/javascripts/eng/comandos/particionaryformatear_eng.js +++ b/admin/WebConsole/idiomas/javascripts/eng/comandos/particionaryformatear_eng.js @@ -1,15 +1,15 @@ //________________________________________________________________________________________________________ // -// Fichero de idiomas javascripts: particionaryformatear_eng.js -// Idioma: Ings +// Javascript language file: particionaryformatear_eng.js +// Language: English //________________________________________________________________________________________________________ TbMsg=new Array; -TbMsg[0]="WARNING.- There are not partitions table modified, therefore no command will be registered"; -TbMsg[1]="WARNING.- There are partitions with the same number, you must select another or remove it clicking in the last column"; -TbMsg[2]="WARNING.- The size of the partition must be greater than zero"; -TbMsg[3]="WARNING.- The partition must be correlative and there would not have spaces between partitions"; -TbMsg[4]="WARNING.- This partition is empty, therefore you can't to perform any operation"; -TbMsg[5]="WARNING.- This partition must be just formatted because the operating system has changed or has changed the size of some partition"; -TbMsg[6]="WARNING.- There is not coherent to hide this partition because it is not a Windows partition"; -TbMsg[7]="WARNING.- There is not coherent to show this partition because it is not a Windows partition"; -TbMsg[8]="You can't add more partitions"; +TbMsg[0]="WARNING: There are no changes in partition table, therefore no action will be executed"; +TbMsg[1]="WARNING: There are partitions with the same number. You must select another one or remove it by clicking in the last column"; +TbMsg[2]="WARNING: Partition size must be greater than zero"; +TbMsg[3]="WARNING: Partitions must be correlatives and they must not have spaces between them"; +TbMsg[4]="WARNING: Empty partition, therefore no action will be executed"; +TbMsg[5]="WARNING: This partition must be formatted because its OS has changed or some partition size has changed."; +TbMsg[6]="WARNING: There is not coherent to hide this partition because it is not a Windows partition"; +TbMsg[7]="WARNING: There is not coherent to show this partition because it is not a Windows partition"; +TbMsg[8]="You cannot add more partitions"; diff --git a/admin/WebConsole/idiomas/javascripts/eng/comandos/restaurarimagen_eng.js b/admin/WebConsole/idiomas/javascripts/eng/comandos/restaurarimagen_eng.js index f6360cc3..d709af9d 100644 --- a/admin/WebConsole/idiomas/javascripts/eng/comandos/restaurarimagen_eng.js +++ b/admin/WebConsole/idiomas/javascripts/eng/comandos/restaurarimagen_eng.js @@ -1,15 +1,15 @@ //________________________________________________________________________________________________________ // -// Fichero de idiomas javascripts: restaurarimagen_eng.js -// Idioma: Inglés +// Javascript language file: restaurarimagen_eng.js +// Language: English //________________________________________________________________________________________________________ TbMsg=new Array; -TbMsg[0]="You must select at least an Image for partition "; -TbMsg[1]="You can only select an Image for partition "; -TbMsg[2]="WARNING: You have selected an Image from other operating system for current partition "; -TbMsg[3]="Are you sure ?"; -TbMsg[4]="You must select at least a partition and an Image"; -TbMsg[5]="You must select at least a image path for partition "; -TbMsg[6]="You must choose only one image of the down"; -TbMsg["FILTER"]="Debe seleccionar al menos un ordenador que tenga la configuración elegida."; -TbMsg["UNICAST"]="\t!!!!! ATENCIÓN !!!!! \nHa seleccionado UNICAST en varios ordenadores,\nLa transferencia puede demorarse en el tiempo"; +TbMsg[0]="You must select an image for this partition"; +TbMsg[1]="You must select at least a partition and an image"; +TbMsg[2]="WARNING: You have selected an image from a different OS for current partition"; +TbMsg[3]="Are you sure ?" +TbMsg[4]="You must select at least an image for this partition" +TbMsg[5]="You must select at least an image path for this partition "; +TbMsg[6]="You must choose the image from only one of the drop-down"; +TbMsg["FILTER"]="You must choose at least one computer with the chosen configuration."; +TbMsg["UNICAST"]="\t!!!!! WARNING !!!!! \nYou have selected UNICAST for multiple computers,\nThe transfer may be delayed in time"; diff --git a/admin/WebConsole/idiomas/javascripts/eng/comandos/restaurarimagenbasica_eng.js b/admin/WebConsole/idiomas/javascripts/eng/comandos/restaurarimagenbasica_eng.js index bce2cdc4..a7023e76 100644 --- a/admin/WebConsole/idiomas/javascripts/eng/comandos/restaurarimagenbasica_eng.js +++ b/admin/WebConsole/idiomas/javascripts/eng/comandos/restaurarimagenbasica_eng.js @@ -1,14 +1,14 @@ //________________________________________________________________________________________________________ // -// Fichero de idiomas javascripts: restaurarimagenbasica_esp.js -// Idioma: Español +// Javascript language file: restaurarimagenbasica_eng.js +// Language: English //________________________________________________________________________________________________________ TbMsg=new Array; -TbMsg[0]="Debe elegir una imagen para esta partición"; -TbMsg[1]="Debe elegir al menos una partición y una imagen"; +TbMsg[0]="You must choose an image for this partition"; +TbMsg[1]="You must choose at least one partition and one image"; TbMsg[2]=""; -TbMsg[3]="¿ Está seguro ?"; -TbMsg[4]="Debe elegir al menos una imagen para la partición"; -TbMsg[5]="Debe elegir al menos un path de imagen para la partición "; -TbMsg[6]="Debe elegir la imagen de uno sólo de los desplegables"; -TbMsg[7]="Debe elegir un método de Sincronización"; +TbMsg[3]="Are you sure?"; +TbMsg[4]="You must choose at least an image for this partition"; +TbMsg[5]="You must choose an image path for this partition"; +TbMsg[6]="You must choose the image from only one of the drop-down"; +TbMsg[7]="You must choose a synchronization method"; diff --git a/admin/WebConsole/idiomas/javascripts/eng/comandos/restaurarsoftincremental_eng.js b/admin/WebConsole/idiomas/javascripts/eng/comandos/restaurarsoftincremental_eng.js index 22a112d9..0cd47096 100644 --- a/admin/WebConsole/idiomas/javascripts/eng/comandos/restaurarsoftincremental_eng.js +++ b/admin/WebConsole/idiomas/javascripts/eng/comandos/restaurarsoftincremental_eng.js @@ -1,14 +1,14 @@ //________________________________________________________________________________________________________ // -// Fichero de idiomas javascripts: restaurarsoftincremental_esp.js -// Idioma: Español +// Javascript language file: restaurarsoftincremental_eng.js +// Language: English //________________________________________________________________________________________________________ TbMsg=new Array; -TbMsg[0]="Debe elegir una imagen para esta partición"; -TbMsg[1]="Debe elegir al menos una partición y una imagen"; +TbMsg[0]="You must select an image for this partition"; +TbMsg[1]="You must select at least a partition and an image"; TbMsg[2]=" "; -TbMsg[3]="¿ Está seguro ?"; -TbMsg[4]="Debe elegir al menos una imagen para la partición"; -TbMsg[5]="Debe elegir al menos un path de imagen para la partición "; -TbMsg[6]="Debe elegir un software incremental para esta partición"; -TbMsg[7]="Debe elegir un método de Sincronización"; +TbMsg[3]="Are you sure ?"; +TbMsg[4]="You must select at least an image for this partition"; +TbMsg[5]="You must select at least an image path for this partition "; +TbMsg[6]="You must choose an incremental software for this partition"; +TbMsg[7]="You must choose a synchronization method"; diff --git a/admin/WebConsole/idiomas/javascripts/eng/comunes_eng.js b/admin/WebConsole/idiomas/javascripts/eng/comunes_eng.js index 271dede0..1a2e7b1f 100644 --- a/admin/WebConsole/idiomas/javascripts/eng/comunes_eng.js +++ b/admin/WebConsole/idiomas/javascripts/eng/comunes_eng.js @@ -1,14 +1,14 @@ //________________________________________________________________________________________________________ // -// Fichero de idiomas javascript: comunes_eng.js -// Idioma: Ings -//________________________________________________________________________________________________________ -CTbMsg=new Array; -CTbMsg[0]="WARNING.- This group contain others groups or elements. If you remove it, you will also remove all these. Are you sure ?"; -CTbMsg[1]="WARNING.- This group will be removed. Are you sure ?"; -CTbMsg[2]="This group has been successfully modified"; -CTbMsg[3]="This group has been successfully removed"; -CTbMsg[4]="The record has been successfully inserted"; -CTbMsg[5]="The record has been successfully modified"; -CTbMsg[6]="The record has been successfully removed"; -CTbMsg[7]="There is not exists any element in stack to be moved into this group"; +// Javascript language file: comunes_eng.js +// Language: English +//____________________________________________________________________________ +TbMsg=new Array; +CTbMsg[0]="WARNING.- This group contain others groups or elements. If you delete it, you will also delete all of them. Are you sure?"; +CTbMsg[1]="WARNING.- This group will be deleted. Are you sure?"; +CTbMsg[2]="This group has been modified successfully "; +CTbMsg[3]="This group has been deleted successfully"; +CTbMsg[4]="The record has been inserted successfully"; +CTbMsg[5]="The record has been modified successfully"; +CTbMsg[6]="The record has been deleted successfully"; +CTbMsg[7]="There is no pending element to move into this group"; diff --git a/admin/WebConsole/idiomas/javascripts/eng/consolaremota_eng.js b/admin/WebConsole/idiomas/javascripts/eng/consolaremota_eng.js index f693216a..e3eff743 100644 --- a/admin/WebConsole/idiomas/javascripts/eng/consolaremota_eng.js +++ b/admin/WebConsole/idiomas/javascripts/eng/consolaremota_eng.js @@ -1,8 +1,8 @@ //________________________________________________________________________________________________________ // -// Fichero de idiomas javascript: consolaremota_eng.js -// Idioma: English -//________________________________________________________________________________________________________ +// Javascript language file: consolaremota_eng.js +// Language: English +//____________________________________________________________________________ TbMsg=new Array; -TbMsg[0]="Attention.-Has there been any error in the Remote Console application"; -TbMsg[1]="The Remote Console request was sent successfully"; +TbMsg[0]="WARNING: Error requesting Remote Console"; +TbMsg[1]="Remote Console request has been sent successfully"; diff --git a/admin/WebConsole/idiomas/javascripts/eng/ejecutaracciones_eng.js b/admin/WebConsole/idiomas/javascripts/eng/ejecutaracciones_eng.js index d8d27714..2bbc31ac 100644 --- a/admin/WebConsole/idiomas/javascripts/eng/ejecutaracciones_eng.js +++ b/admin/WebConsole/idiomas/javascripts/eng/ejecutaracciones_eng.js @@ -1,10 +1,9 @@ //____________________________________________________________________________ // -// Fichero de idiomas javascript: ejecutaracciones_eng.js -// Idioma: Ingles +// Javascript language file: ejecutaracciones_eng.js +// Language: English //____________________________________________________________________________ TbMsg=new Array; -TbMsg[0]="ATENCIÓN.- El Procedimiento será ejecutado aplicándolo a este ámbito. ¿ Está seguro ?"; -TbMsg[1]="El Procedimiento ha sido gestionado correctamente para este ámbito"; -TbMsg[2]="ATENCIÓN.- El Procedimiento se convertirá en procedimiento de inicio (Autoexec) para todos los ordenadores de este ámbito. ¿ Está seguro ?"; - +TbMsg[0]="WARNING: This Procedure will be executed by applying it to this scope. Are you sure?"; +TbMsg[1]="This Procedure has been managed successfully for this scope"; +TbMsg[2]="WARNING: This Procedure will become Starting Procedure (Autoexec)for all the computers in this scope. Are you sure?"; diff --git a/admin/WebConsole/idiomas/javascripts/eng/ejecutarprocedimientos_eng.js b/admin/WebConsole/idiomas/javascripts/eng/ejecutarprocedimientos_eng.js index 698e4c21..f35e2d10 100644 --- a/admin/WebConsole/idiomas/javascripts/eng/ejecutarprocedimientos_eng.js +++ b/admin/WebConsole/idiomas/javascripts/eng/ejecutarprocedimientos_eng.js @@ -1,8 +1,8 @@ //____________________________________________________________________________ // -// Fichero de idiomas javascript: ejecutarprocedimientos_eng.js -// Idioma: Ingls +// Javascript language file: ejecutarprocedimientos_eng.js +// Language: English //____________________________________________________________________________ TbMsg=new Array; -TbMsg[0]="WARNING.- This procedure will be executed Applying this environment. Are you sure ?"; -TbMsg[1]="This procedure has been successfully executed for this environment"; +TbMsg[0]="WARNING: This Procedure will be executed by applying it to this scope. Are you sure?"; +TbMsg[1]="This procedure has been executed successfully for this scope"; diff --git a/admin/WebConsole/idiomas/javascripts/eng/hardwares_eng.js b/admin/WebConsole/idiomas/javascripts/eng/hardwares_eng.js index 28e179a7..182844e4 100644 --- a/admin/WebConsole/idiomas/javascripts/eng/hardwares_eng.js +++ b/admin/WebConsole/idiomas/javascripts/eng/hardwares_eng.js @@ -1,7 +1,6 @@ //____________________________________________________________________________ // -// Fichero de idiomas javascript: hardwares.js -// Idioma: Ings +// Javascript language file: hardwares.js +// Language: English //____________________________________________________________________________ TbMsg=new Array; - diff --git a/admin/WebConsole/idiomas/javascripts/eng/iconos_eng.js b/admin/WebConsole/idiomas/javascripts/eng/iconos_eng.js index 25dd6bb7..aec2cbed 100644 --- a/admin/WebConsole/idiomas/javascripts/eng/iconos_eng.js +++ b/admin/WebConsole/idiomas/javascripts/eng/iconos_eng.js @@ -1,7 +1,7 @@ //____________________________________________________________________________ // -// Fichero de idiomas javascript: acciones_esp.js -// Idioma: Español +// Javascript language file: acciones_esp.js +// Language: English //____________________________________________________________________________ TbMsg=new Array; -TbMsg["DESCRIP"]="Description is a mandatory"; +TbMsg["DESCRIP"]="Description is mandatory."; diff --git a/admin/WebConsole/idiomas/javascripts/eng/imagenes_eng.js b/admin/WebConsole/idiomas/javascripts/eng/imagenes_eng.js index 171afd22..f5e46fa2 100644 --- a/admin/WebConsole/idiomas/javascripts/eng/imagenes_eng.js +++ b/admin/WebConsole/idiomas/javascripts/eng/imagenes_eng.js @@ -1,7 +1,6 @@ //____________________________________________________________________________ // -// Fichero de idiomas javascript: imagenes.js -// Idioma: Ings +// Javascript language file: imagenes.js +// Language: English //____________________________________________________________________________ TbMsg=new Array; - diff --git a/admin/WebConsole/idiomas/javascripts/eng/imagenincremental_eng.js b/admin/WebConsole/idiomas/javascripts/eng/imagenincremental_eng.js index e9e69b92..ff046578 100644 --- a/admin/WebConsole/idiomas/javascripts/eng/imagenincremental_eng.js +++ b/admin/WebConsole/idiomas/javascripts/eng/imagenincremental_eng.js @@ -1,8 +1,8 @@ //____________________________________________________________________________ // -// Fichero de idiomas javascript: incrementalcomponente_soft_eng.js -// Idioma: Ings +// Javascript language file: incrementalcomponente_soft_eng.js +// Language: English //____________________________________________________________________________ TbMsg=new Array; -TbMsg[0]="This incremental software has been successfully included in this image"; -TbMsg[1]="This incremental software has been successfully excluded from this iamge"; +TbMsg[0]="This incremental software has been included successfully into this image"; +TbMsg[1]="This incremental software has been excluded successfully from this image"; diff --git a/admin/WebConsole/idiomas/javascripts/eng/inclusionacciones_eng.js b/admin/WebConsole/idiomas/javascripts/eng/inclusionacciones_eng.js index bb842521..c76954f4 100644 --- a/admin/WebConsole/idiomas/javascripts/eng/inclusionacciones_eng.js +++ b/admin/WebConsole/idiomas/javascripts/eng/inclusionacciones_eng.js @@ -1,10 +1,9 @@ //________________________________________________________________________________________________________ // -// Fichero de idiomas javascript: inclusionacciones_eng.js -// Idioma: Ingles -//________________________________________________________________________________________________________ +// Javascript language file: inclusionacciones_eng.js +// Language: English +//____________________________________________________________________________ TbMsg=new Array; TbMsg[0]=""; -TbMsg[1]=" ATENCIÓN: Debe introducir un número de orden correcto"; -TbMsg[2]="El proceso se ha ejecutado correctamente"; - +TbMsg[1]="WARNING: You must enter a correct sequence number."; +TbMsg[2]="Process has been executed successfully"; diff --git a/admin/WebConsole/idiomas/javascripts/eng/incrementalcomponente_soft_eng.js b/admin/WebConsole/idiomas/javascripts/eng/incrementalcomponente_soft_eng.js index 16c594c8..7e51b034 100644 --- a/admin/WebConsole/idiomas/javascripts/eng/incrementalcomponente_soft_eng.js +++ b/admin/WebConsole/idiomas/javascripts/eng/incrementalcomponente_soft_eng.js @@ -1,8 +1,8 @@ //____________________________________________________________________________ // -// Fichero de idiomas javascript: incrementalcomponente_soft_eng.js -// Idioma: Ings +// Javascript language file: incrementalcomponente_soft_eng.js +// Language: English //____________________________________________________________________________ TbMsg=new Array; -TbMsg[0]="This software component has been successfully included in this incremental software"; -TbMsg[1]="This software component has been successfully excluded from this incremental software"; +TbMsg[0]="This software component has been included successfully into this incremental software"; +TbMsg[1]="This software component has been excluded successfully from this incremental software"; diff --git a/admin/WebConsole/idiomas/javascripts/eng/informacion_menus_eng.js b/admin/WebConsole/idiomas/javascripts/eng/informacion_menus_eng.js index 79274efe..682afaef 100644 --- a/admin/WebConsole/idiomas/javascripts/eng/informacion_menus_eng.js +++ b/admin/WebConsole/idiomas/javascripts/eng/informacion_menus_eng.js @@ -1,9 +1,9 @@ //____________________________________________________________________________ // -// Fichero de idiomas javascript: informacion_menus_eng.js -// Idioma: Ings +// Javascript language file: informacion_menus_eng.js +// Language: English //____________________________________________________________________________ TbMsg=new Array; -TbMsg[0]="WARNING.- This item will be removed. Are you sure ?"; -TbMsg[1]="This item has been successfully excluded from this menu"; -TbMsg[2]="This item has been successfully modified"; +TbMsg[0]="WARNING: This item will be deleted. Are you sure?"; +TbMsg[1]="This item has been excluded successfully from this menu"; +TbMsg[2]="This item has been modified successfully"; diff --git a/admin/WebConsole/idiomas/javascripts/eng/menus_eng.js b/admin/WebConsole/idiomas/javascripts/eng/menus_eng.js index 39ea2374..c8b562a9 100644 --- a/admin/WebConsole/idiomas/javascripts/eng/menus_eng.js +++ b/admin/WebConsole/idiomas/javascripts/eng/menus_eng.js @@ -1,7 +1,6 @@ //____________________________________________________________________________ // -// Fichero de idiomas javascript: menus_eng.js -// Idioma: Ings +// Javascript language file: menus_eng.js +// Language: English //____________________________________________________________________________ TbMsg=new Array; - diff --git a/admin/WebConsole/idiomas/javascripts/eng/perfilcomponente_hard_eng.js b/admin/WebConsole/idiomas/javascripts/eng/perfilcomponente_hard_eng.js index 8a102354..beecbb53 100644 --- a/admin/WebConsole/idiomas/javascripts/eng/perfilcomponente_hard_eng.js +++ b/admin/WebConsole/idiomas/javascripts/eng/perfilcomponente_hard_eng.js @@ -1,8 +1,8 @@ //____________________________________________________________________________ // -// Fichero de idiomas javascript: perfilcomponente_hard_eng.js -// Idioma: Ings +// Javascript language file: perfilcomponente_hard_eng.js +// Language: English //____________________________________________________________________________ TbMsg=new Array; -TbMsg[0]="This hardware component has been successfully included in this profile"; -TbMsg[1]="This hardware component has been successfully excluded from this profile"; +TbMsg[0]="This hardware component has been included successfully into this profile"; +TbMsg[1]="This hardware component has been excluded successfully from this profile"; diff --git a/admin/WebConsole/idiomas/javascripts/eng/perfilcomponente_soft_eng.js b/admin/WebConsole/idiomas/javascripts/eng/perfilcomponente_soft_eng.js index d693301c..64ee42cb 100644 --- a/admin/WebConsole/idiomas/javascripts/eng/perfilcomponente_soft_eng.js +++ b/admin/WebConsole/idiomas/javascripts/eng/perfilcomponente_soft_eng.js @@ -1,8 +1,8 @@ //____________________________________________________________________________ // -// Fichero de idiomas javascript: perfilcomponente_soft_eng.js -// Idioma: Ings +// Javascript language file: perfilcomponente_soft_eng.js +// Language: English //____________________________________________________________________________ TbMsg=new Array; -TbMsg[0]="This software component has been successfully included in this profile"; -TbMsg[1]="This software component has been successfully excluded from this profile"; +TbMsg[0]="This software component has been included successfully into this profile"; +TbMsg[1]="This software component has been excluded successfully from this profile"; diff --git a/admin/WebConsole/idiomas/javascripts/eng/procedimientoscomandos_eng.js b/admin/WebConsole/idiomas/javascripts/eng/procedimientoscomandos_eng.js index c01dbc5d..48b35d95 100644 --- a/admin/WebConsole/idiomas/javascripts/eng/procedimientoscomandos_eng.js +++ b/admin/WebConsole/idiomas/javascripts/eng/procedimientoscomandos_eng.js @@ -1,10 +1,10 @@ //____________________________________________________________________________ // -// Fichero de idiomas javascript: procedimientoscomandos_eng.js -// Idioma: Ings +// Javascript language file: procedimientoscomandos_eng.js +// Language: English //____________________________________________________________________________ TbMsg=new Array; -TbMsg[0]="WARNING.- This command will be excluded from procedure. Are you sure ?"; -TbMsg[1]="WARNING: You must introduce an order number"; -TbMsg[2]="This command has been successfully excluded from this procedure"; -TbMsg[3]="This commad has been successfully modified"; +TbMsg[0]="WARNING: This command will be excluded from this procedure. Are you sure?"; +TbMsg[1]="WARNING: You must enter a sequence number"; +TbMsg[2]="This command has been excluded successfully from this procedure"; +TbMsg[3]="This command has been modified successfully"; diff --git a/admin/WebConsole/idiomas/javascripts/eng/programaciones_eng.js b/admin/WebConsole/idiomas/javascripts/eng/programaciones_eng.js index 35955178..de2f62f6 100644 --- a/admin/WebConsole/idiomas/javascripts/eng/programaciones_eng.js +++ b/admin/WebConsole/idiomas/javascripts/eng/programaciones_eng.js @@ -1,21 +1,21 @@ //________________________________________________________________________________________________________ // -// Fichero de idiomas javascript: programaciones_eng.js -// Idioma: Ingls -//________________________________________________________________________________________________________ +// Javascript language file: programaciones_eng.js +// Language: English +//____________________________________________________________________________ TbMsg=new Array; -TbMsg[0]="ATENCIN: Debe elegir algn ao"; -TbMsg[1]="ATENCIN: Debe elegir algn mes"; -TbMsg[2]="ATENCIN: Debe elegir algn da de la semana, alguna semana o algn da del mes"; -TbMsg[3]="ATENCIN: Debe elegir algn da del mes"; -TbMsg[4]="ATENCIN: Debe elegir alguna hora"; -TbMsg[5]="ATENCIN: Debe introducir la descripcin del bloque de programacion"; -TbMsg[6]="ATENCIN: Debe introducir los minutos entre los valores 0 y 59"; -TbMsg[7]="ATENCIN: Debe introducir los segundos entre los valores 0 y 59"; -TbMsg[8]="ATENCIN: Debe insertar algn bloque para poder suspender temporalmente la programacin de todos ellos"; -TbMsg[9]="La programacin se ha suspendido temporalmente con xito"; -TbMsg[10]="La programacin se ha activado de nuevo con xito"; -TbMsg[11]="El bloque de programacin se ha registrado correctamente"; -TbMsg[12]="El bloque de programacin se ha modificado correctamente"; -TbMsg[13]="El bloque de programacin se ha eliminado correctamente"; -TbMsg[14]="No existe ningn bloque seleccionado"; +TbMsg[0]="WARNING: You must choose a year"; +TbMsg[1]="WARNING: You must choose a month"; +TbMsg[2]="WARNING: You must choose a weekday, a week or a day of the month"; +TbMsg[3]="WARNING: You must choose a day of the month"; +TbMsg[4]="WARNING: You must choose a time"; +TbMsg[5]="WARNING: You must enter the programming block description"; +TbMsg[6]="WARNING: Minutes must be from 0 to 59"; +TbMsg[7]="WARNING: Seconds must be from 0 to 59"; +TbMsg[8]="WARNING: You must enter a block to pause the programming of all of them"; +TbMsg[9]="Programming has been paused successfully"; +TbMsg[10]="Programming has been resumed successfully"; +TbMsg[11]="Programming block has been registered successfully"; +TbMsg[12]="Programming block has been modified successfully"; +TbMsg[13]="Programming block has been deleted successfully"; +TbMsg[14]="There is no selected block"; diff --git a/admin/WebConsole/idiomas/javascripts/eng/propiedades_aulas_eng.js b/admin/WebConsole/idiomas/javascripts/eng/propiedades_aulas_eng.js index 82f9c0c1..0428c2d0 100644 --- a/admin/WebConsole/idiomas/javascripts/eng/propiedades_aulas_eng.js +++ b/admin/WebConsole/idiomas/javascripts/eng/propiedades_aulas_eng.js @@ -1,26 +1,26 @@ //________________________________________________________________________________________________________ // -// Fichero de idiomas javascript: propiedades_aulas_eng.js -// Idioma: Inglés -//________________________________________________________________________________________________________ +// Javascript language file: propiedades_aulas_eng.js +// Language: English +//____________________________________________________________________________ TbMsg=new Array; -TbMsg[0]="El nombre del aula debe contener caracteres alfanumericos"; -TbMsg[1]="You must introduce a number of Capacity for this lab"; -TbMsg[2]="WARNING.- This lab contain others groups or labs. If you remove it, you will also remove all these. Are you sure?"; -TbMsg[3]="Time for begining of reserves periode must be smaller than final time"; -TbMsg[4]="Multicast speed is not valid, use numbers only"; -TbMsg[5]="Netmask is not valid"; +TbMsg[0]="Lab name must contain alphanumeric characters"; +TbMsg[1]="You must enter the maximum number of people for this lab"; +TbMsg[2]="WARNING: This lab contains computers groups or computers. If you delete it, you will also delete all of them. Are you sure?"; +TbMsg[3]="Start time for reservations must be before final time"; +TbMsg[4]="Multicast speed is not valid, please use numbers only"; +TbMsg[5]="Net mask is not valid"; TbMsg[6]="P2P mode is not valid"; -TbMsg[7]="El tiempo (segundos ) de semillero despues de la descarga p2p no es valida"; +TbMsg[7]="Seed time (seconds) after p2p download is not valid"; TbMsg[8]="Multicast mode is not valid"; TbMsg[9]="Multicast IP address is not valid"; TbMsg[10]="Multicast port is not valid"; TbMsg[11]="Multicast speed is not valid, use numbers only"; -TbMsg[12]="DNS server IP address is not valid"; +TbMsg[12]="IP address of DNS server is not valid"; TbMsg[13]="Proxy server URL is not valid"; -TbMsg[14]="Deben introducirse datos de validacion: pagina de login y pagina de validacion"; -TbMsg[15]="La URL de la pagina de login no es valida"; -TbMsg[16]="La URL de la pagina de validación no es valida"; -TbMsg[17]="La ubicacion solo puede contener caracteres alfanumericos"; -TbMsg[18]="Los comentarios solo pueden contener caracteres alfanumericos"; -TbMsg[19]="NTP server IP address is not valid"; +TbMsg[14]="You must enter validation data: login page and validation page"; +TbMsg[15]="Login page URL is not valid"; +TbMsg[16]="Validation page URL is not valid"; +TbMsg[17]="The location can only contain alphanumeric characters" +TbMsg[18]="The comments can only contain alphanumeric characters" +TbMsg[19]="IP address of NTP server is not valid"; diff --git a/admin/WebConsole/idiomas/javascripts/eng/propiedades_centros_eng.js b/admin/WebConsole/idiomas/javascripts/eng/propiedades_centros_eng.js index 874bff00..32f1b408 100644 --- a/admin/WebConsole/idiomas/javascripts/eng/propiedades_centros_eng.js +++ b/admin/WebConsole/idiomas/javascripts/eng/propiedades_centros_eng.js @@ -1,10 +1,9 @@ //________________________________________________________________________________________________________ // -// Fichero de idiomas javascript: propiedades_usuarios_eng.js -// Idioma: Ings -//________________________________________________________________________________________________________ +// Javascript language file: propiedades_usuarios_eng.js +// Language: English +//____________________________________________________________________________ TbMsg=new Array; -TbMsg[0]="You must introduce a name for this Organizing Unit y slo puede contener caracteres alfanumricos"; -TbMsg[1]="El comentario slo puede contener caracteres alfanumricos"; -TbMsg[2]="El directorio slo puede contener caracteres alfanumricos"; - +TbMsg[0]="You must enter a name for the Organizational Unit. It can only contain alphanumeric characters"; +TbMsg[1]="The comment can only contain alphanumeric characters"; +TbMsg[2]="The directory can only contain alphanumeric characters"; diff --git a/admin/WebConsole/idiomas/javascripts/eng/propiedades_componentehardwares_eng.js b/admin/WebConsole/idiomas/javascripts/eng/propiedades_componentehardwares_eng.js index 4ee13c51..18c279af 100644 --- a/admin/WebConsole/idiomas/javascripts/eng/propiedades_componentehardwares_eng.js +++ b/admin/WebConsole/idiomas/javascripts/eng/propiedades_componentehardwares_eng.js @@ -1,8 +1,8 @@ //________________________________________________________________________________________________________ // -// Fichero de idiomas javascript: propiedades_componentehardwares_eng.js -// Idioma: Ings -//________________________________________________________________________________________________________ +// Javascript language file: propiedades_componentehardwares_eng.js +// Language: English +//____________________________________________________________________________ TbMsg=new Array; -TbMsg[0]="You must introduce a name for this hardware component "; -TbMsg[1]="You must introduce a hardware type for this component";
\ No newline at end of file +TbMsg[0]="You must enter a name for this hardware component "; +TbMsg[1]="You must enter a hardware type for this component"; diff --git a/admin/WebConsole/idiomas/javascripts/eng/propiedades_componentesoftwares_eng.js b/admin/WebConsole/idiomas/javascripts/eng/propiedades_componentesoftwares_eng.js index faf928ba..7fd39070 100644 --- a/admin/WebConsole/idiomas/javascripts/eng/propiedades_componentesoftwares_eng.js +++ b/admin/WebConsole/idiomas/javascripts/eng/propiedades_componentesoftwares_eng.js @@ -1,9 +1,9 @@ //________________________________________________________________________________________________________ // -// Fichero de idiomas javascript: propiedades_componentesoftwares_eng.js -// Idioma: Ings -//________________________________________________________________________________________________________ +// Javascript language file: propiedades_componentesoftwares_eng.js +// Language: English +//____________________________________________________________________________ TbMsg=new Array; -TbMsg[0]="You must introduce a name for this software component "; -TbMsg[1]="You must introduce a software type for this component"; -TbMsg[2]="You must introduce an operating system name for this component";
\ No newline at end of file +TbMsg[0]="You must enter a name for this software component "; +TbMsg[1]="You must enter a software type for this component"; +TbMsg[2]="You must enter an OS name for this component"; diff --git a/admin/WebConsole/idiomas/javascripts/eng/propiedades_entidades_eng.js b/admin/WebConsole/idiomas/javascripts/eng/propiedades_entidades_eng.js index bfc09a61..61bf4eb0 100644 --- a/admin/WebConsole/idiomas/javascripts/eng/propiedades_entidades_eng.js +++ b/admin/WebConsole/idiomas/javascripts/eng/propiedades_entidades_eng.js @@ -1,9 +1,9 @@ //________________________________________________________________________________________________________ // -// Fichero de idiomas javascript: propiedades_usuarios_eng.js -// Idioma: Ings -//________________________________________________________________________________________________________ +// Javascript language file: propiedades_entidades_eng.js +// Language: English +//____________________________________________________________________________ TbMsg=new Array; -TbMsg[0]="You must introduce a name for this Entity y slo puede contener caracteres alfanumricos"; -TbMsg[1]="El comentario slo puede contener caracteres alfanumricos"; -TbMsg['PXE']="Si cambia est opcin debe guardar de nuevo la configuracin \ndel arranque PXE de los clientes en NetBootAvanzado"; +TbMsg[0]="You must enter a name for this Entity. It can only contain alphanumeric characters"; +TbMsg[1]="The comment can only contain alphanumeric characters"; +TbMsg['PXE']="If you change this option, you must save again the PXE boot configuration \nof clients in AdvancedNetBoot"; diff --git a/admin/WebConsole/idiomas/javascripts/eng/propiedades_grupos_eng.js b/admin/WebConsole/idiomas/javascripts/eng/propiedades_grupos_eng.js index 791611bf..cf0fffa0 100644 --- a/admin/WebConsole/idiomas/javascripts/eng/propiedades_grupos_eng.js +++ b/admin/WebConsole/idiomas/javascripts/eng/propiedades_grupos_eng.js @@ -1,7 +1,7 @@ //________________________________________________________________________________________________________ // -// Fichero de idiomas javascript: propiedades_grupos_eng.js -// Idioma: Ings +// Javascript language file: propiedades_grupos_eng.js +// Language: English //________________________________________________________________________________________________________ TbMsg=new Array; -TbMsg[0]="You must introduce a name for this group"; +TbMsg[0]="You must enter a name for this group"; diff --git a/admin/WebConsole/idiomas/javascripts/eng/propiedades_imagenes_eng.js b/admin/WebConsole/idiomas/javascripts/eng/propiedades_imagenes_eng.js index 2f5301dc..fc16ecd0 100644 --- a/admin/WebConsole/idiomas/javascripts/eng/propiedades_imagenes_eng.js +++ b/admin/WebConsole/idiomas/javascripts/eng/propiedades_imagenes_eng.js @@ -1,9 +1,15 @@ //________________________________________________________________________________________________________ // -// Fichero de idiomas javascript: propiedades_imagenes_eng.js -// Idioma: Ings -//________________________________________________________________________________________________________ +// Javascript language file: propiedades_imagenes_eng.js propiedades_imagenes_eng.js +// Language: English +//____________________________________________________________________________ TbMsg=new Array; -TbMsg[0]="You must introduce a name for this image"; -TbMsg[1]="The image must contain at least some of a software profile"; -TbMsg[2]="WARNING: There are computers with this image in some of their partitions. Are you sure ?"; +TbMsg[0]="You must enter a name for this image"; +TbMsg[1]="The image must contain at least one software profile"; +TbMsg[2]="WARNING: There are computers with this image in one of their partitions. Are you sure?"; +TbMsg[3]="Canonical name of image-file fichero-imagen can only contain alphanumeric characters"; +TbMsg[4]="Missing partition number"; +TbMsg[5]="Missing partition type"; +TbMsg[6]="Missing repository"; +TbMsg[7]="Missing comment"; +TbMsg[8]="You must choose basic image for attaching this one"; diff --git a/admin/WebConsole/idiomas/javascripts/eng/propiedades_menus_eng.js b/admin/WebConsole/idiomas/javascripts/eng/propiedades_menus_eng.js index ab85bf7e..646339f7 100644 --- a/admin/WebConsole/idiomas/javascripts/eng/propiedades_menus_eng.js +++ b/admin/WebConsole/idiomas/javascripts/eng/propiedades_menus_eng.js @@ -1,9 +1,9 @@ //____________________________________________________________________________ // -// Fichero de idiomas javascript: propiedades_menus_eng.js -// Idioma: Ings +// Javascript language file: propiedades_menus_eng.js propiedades_menus_eng.js +// Language: English //____________________________________________________________________________ TbMsg=new Array; -TbMsg[0]="You must introduce a name for this menu"; -TbMsg[1]="WARNING: There are computers managed by this menu. You can't remove them until you change menu to this computers"; -TbMsg[2]="Las url de los mens personalizados,privados o pblicos, deben empezar con http:// o https://"; +TbMsg[0]="You must enter a name for this menu"; +TbMsg[1]="WARNING: Some computers have already this menu. You can't delete it until you change that menu in those computers"; +TbMsg[2]="URLs of Personalized, Private or Public menus must start with http:// or https://"; diff --git a/admin/WebConsole/idiomas/javascripts/eng/propiedades_ordenadores_eng.js b/admin/WebConsole/idiomas/javascripts/eng/propiedades_ordenadores_eng.js index 9ecf454d..7ddd7ab6 100644 --- a/admin/WebConsole/idiomas/javascripts/eng/propiedades_ordenadores_eng.js +++ b/admin/WebConsole/idiomas/javascripts/eng/propiedades_ordenadores_eng.js @@ -1,13 +1,13 @@ //________________________________________________________________________________________________________ // -// Fichero de idiomas javascript: propiedades_ordenadores_eng.js -// Idioma: Ings +// Javascript language file: propiedades_ordenadores_eng.js +// Language: English //________________________________________________________________________________________________________ TbMsg=new Array; -TbMsg[0]="El nombre del ordenador puede contener caracteres alfanumricos, subrayados y guiones"; -TbMsg[1]="You must introduce an IP Address"; -TbMsg[2]="You must introduce a MAC Address"; -TbMsg[3]="The serial number must be an alphanumeric value"; +TbMsg[0]="Computer name can contain alphanumeric characters, underlined and hyphens"; +TbMsg[1]="You must enter an IP Address"; +TbMsg[2]="You must enter a MAC Address"; +TbMsg[3]="Serial number must be an alphanumeric character"; TbMsg[4]=""; -TbMsg[5]="You must introduce a OpenGnsys server"; -TbMsg[6]="Deben introducirse datos de validacin: pgina de login y pgina de validacin"; +TbMsg[5]="You must enter a default OpenGnsys repository"; +TbMsg[6]="You must enter validation data: login page and validation page"; diff --git a/admin/WebConsole/idiomas/javascripts/eng/propiedades_perfilhardwares_eng.js b/admin/WebConsole/idiomas/javascripts/eng/propiedades_perfilhardwares_eng.js index 25ee5642..cc20b204 100644 --- a/admin/WebConsole/idiomas/javascripts/eng/propiedades_perfilhardwares_eng.js +++ b/admin/WebConsole/idiomas/javascripts/eng/propiedades_perfilhardwares_eng.js @@ -1,8 +1,8 @@ //________________________________________________________________________________________________________ // -// Fichero de idiomas javascript: propiedades_perfilhardwares_eng.js -// Idioma: Ings +// Javascript language file: propiedades_perfilhardwares_eng.js +// Language: English //________________________________________________________________________________________________________ TbMsg=new Array; -TbMsg[0]="You must introduce a name for this hardware profile"; -TbMsg[1]="WARNING: There are computers with this profile. You can't remove them until you change hardware profile to this computers"; +TbMsg[0]="You must enter a name for this hardware profile"; +TbMsg[1]="WARNING: Some computers contain this hardware profile. You can't delete it until you change hardware profile in those computers"; diff --git a/admin/WebConsole/idiomas/javascripts/eng/propiedades_perfilsoftwares_eng.js b/admin/WebConsole/idiomas/javascripts/eng/propiedades_perfilsoftwares_eng.js index 712f263b..b82551d2 100644 --- a/admin/WebConsole/idiomas/javascripts/eng/propiedades_perfilsoftwares_eng.js +++ b/admin/WebConsole/idiomas/javascripts/eng/propiedades_perfilsoftwares_eng.js @@ -1,8 +1,8 @@ //________________________________________________________________________________________________________ // -// Fichero de idiomas javascript: propiedades_perfilsoftwares_eng.js -// Idioma: Ings +// Javascript language file: propiedades_perfilsoftwares_eng.js +// Language: English //________________________________________________________________________________________________________ TbMsg=new Array; -TbMsg[0]="You must introduce a name for this software profile"; -TbMsg[1]="WARNING: There are images with this profile. You can't remove them until you change software profile to this images"; +TbMsg[0]="You must enter a name for this software profile"; +TbMsg[1]="WARNING: Some computers contain this software profile. You can't delete it until you change software profile in those computers"; diff --git a/admin/WebConsole/idiomas/javascripts/eng/propiedades_procedimientos_eng.js b/admin/WebConsole/idiomas/javascripts/eng/propiedades_procedimientos_eng.js index 03c1d5d7..7fb743ce 100644 --- a/admin/WebConsole/idiomas/javascripts/eng/propiedades_procedimientos_eng.js +++ b/admin/WebConsole/idiomas/javascripts/eng/propiedades_procedimientos_eng.js @@ -1,7 +1,7 @@ //________________________________________________________________________________________________________ // -// Fichero de idiomas javascript: propiedades_procedimientos_eng.js -// Idioma: Ings +// Javascript language file: propiedades_procedimientos_eng.js +// Language: English //________________________________________________________________________________________________________ TbMsg=new Array; -TbMsg[0]="You must introduce a name for this procedure"; +TbMsg[0]="You must enter a name for this procedure"; diff --git a/admin/WebConsole/idiomas/javascripts/eng/propiedades_repositorios_eng.js b/admin/WebConsole/idiomas/javascripts/eng/propiedades_repositorios_eng.js index bc243de7..85dda095 100644 --- a/admin/WebConsole/idiomas/javascripts/eng/propiedades_repositorios_eng.js +++ b/admin/WebConsole/idiomas/javascripts/eng/propiedades_repositorios_eng.js @@ -1,11 +1,11 @@ //____________________________________________________________________________ // -// Fichero de idiomas javascript: propiedades_repositorios_eng.js -// Idioma: Ingles +// Javascript language file: propiedades_repositorios_eng.js +// Language: English //____________________________________________________________________________ TbMsg=new Array; -TbMsg[0]="El nombre del repositorio sólo puede contener caracteres alfanuméricos"; -TbMsg[1]="Debe introducir una dirección IP"; -TbMsg[2]="ATENCIÓN: Hay imágenes alojadas por este repositorio. ¿Está seguro de querer eliminarlo ?"; -TbMsg[3]="Debe introducir un puerto de comunicaciones para los clientes"; -TbMsg[4]="Los comentarios sólo pueden contener caracteres alfanuméricos"; +TbMsg[0]="Repository name can only contain alphanumeric characters"; +TbMsg[1]="You must enter IP address"; +TbMsg[2]="WARNING: There are computers assigned to this repository. Do you really want to delete it?"; +TbMsg[3]="You must enter Comm port for clients"; +TbMsg[4]="Comments can only contain alphanumeric characters."; diff --git a/admin/WebConsole/idiomas/javascripts/eng/propiedades_reservas_eng.js b/admin/WebConsole/idiomas/javascripts/eng/propiedades_reservas_eng.js index d3dc6fb6..f43a22aa 100644 --- a/admin/WebConsole/idiomas/javascripts/eng/propiedades_reservas_eng.js +++ b/admin/WebConsole/idiomas/javascripts/eng/propiedades_reservas_eng.js @@ -1,11 +1,11 @@ //________________________________________________________________________________________________________ // -// Fichero de idiomas javascript: propiedades_imagenes_eng.js -// Idioma: Inglés +// Javascript language file: propiedades_reservas_eng.js +// Language: English //________________________________________________________________________________________________________ TbMsg=new Array; -TbMsg[0]="You must introduce a name for this reserva"; -TbMsg[1]="The image must contain at least some of a petitioner"; -TbMsg[2]="You must reserve at least a Lab"; -TbMsg[3]="You must to specify some state from this reserve"; -TbMsg[4]="WARNING.- You has specified time for previous action from this reserve. Are you sure?"; +TbMsg[0]="You must enter a name for this reservation"; +TbMsg[1]="The image must contain at least one petitioner"; +TbMsg[2]="You must choose one lab for this reservation"; +TbMsg[3]="You must specify state for this reservation"; +TbMsg[4]="WARNING: You have specified some time for previous actions to this reservation. Are you sure?" diff --git a/admin/WebConsole/idiomas/javascripts/eng/propiedades_softincrementales_eng.js b/admin/WebConsole/idiomas/javascripts/eng/propiedades_softincrementales_eng.js index e97e500c..5afa1caf 100644 --- a/admin/WebConsole/idiomas/javascripts/eng/propiedades_softincrementales_eng.js +++ b/admin/WebConsole/idiomas/javascripts/eng/propiedades_softincrementales_eng.js @@ -1,7 +1,7 @@ //________________________________________________________________________________________________________ // -// Fichero de idiomas javascript: propiedades_softincrementales_eng.js -// Idioma: Ings +// Javascript language file: propiedades_softincrementales_eng.js +// Language: English //________________________________________________________________________________________________________ TbMsg=new Array; -TbMsg[0]="You must introduce a name for this incremental software"; +TbMsg[0]="You must enter a name for this incremental software"; diff --git a/admin/WebConsole/idiomas/javascripts/eng/propiedades_tareas_eng.js b/admin/WebConsole/idiomas/javascripts/eng/propiedades_tareas_eng.js index eede2409..ffceef96 100644 --- a/admin/WebConsole/idiomas/javascripts/eng/propiedades_tareas_eng.js +++ b/admin/WebConsole/idiomas/javascripts/eng/propiedades_tareas_eng.js @@ -1,7 +1,9 @@ //________________________________________________________________________________________________________ // -// Fichero de idiomas javascript: propiedades_tareas_eng.js -// Idioma: Ings +// Javascript language file: propiedades_tareas_eng.js +// Language: English //________________________________________________________________________________________________________ TbMsg=new Array; -TbMsg[0]="You must introduce a name for this task"; +TbMsg[0]="You must enter a name for this task"; +TbMsg[1]="You must choose a scope for this task"; +TbMsg[2]="WARNING: If you do not choose a scope for this task you will not be able to add procedures to this task. You can only include other tasks with their own scopes."; diff --git a/admin/WebConsole/idiomas/javascripts/eng/propiedades_tipohardwares_eng.js b/admin/WebConsole/idiomas/javascripts/eng/propiedades_tipohardwares_eng.js index 2cef3703..816b645b 100644 --- a/admin/WebConsole/idiomas/javascripts/eng/propiedades_tipohardwares_eng.js +++ b/admin/WebConsole/idiomas/javascripts/eng/propiedades_tipohardwares_eng.js @@ -1,8 +1,7 @@ //________________________________________________________________________________________________________ // -// Fichero de idiomas javascript: propiedades_tipohardwares_eng.js -// Idioma: Ings +// Javascript language file: propiedades_tipohardwares_eng.js +// Language: English //________________________________________________________________________________________________________ TbMsg=new Array; -TbMsg[0]="You must introduce a name for this hardware type "; - +TbMsg[0]="You must enter a name for this hardware type "; diff --git a/admin/WebConsole/idiomas/javascripts/eng/propiedades_trabajos_eng.js b/admin/WebConsole/idiomas/javascripts/eng/propiedades_trabajos_eng.js index f90396e0..7d1a3a8d 100644 --- a/admin/WebConsole/idiomas/javascripts/eng/propiedades_trabajos_eng.js +++ b/admin/WebConsole/idiomas/javascripts/eng/propiedades_trabajos_eng.js @@ -1,7 +1,7 @@ //________________________________________________________________________________________________________ // -// Fichero de idiomas javascript: propiedades_trabajos_eng.js -// Idioma: Ings +// Javascript language file: propiedades_trabajos_eng.js +// Language: English //________________________________________________________________________________________________________ TbMsg=new Array; -TbMsg[0]="You must introduce a name for this job"; +TbMsg[0]="You must enter a name for this job"; diff --git a/admin/WebConsole/idiomas/javascripts/eng/propiedades_universidades_eng.js b/admin/WebConsole/idiomas/javascripts/eng/propiedades_universidades_eng.js index 7477ed4b..565f08e8 100644 --- a/admin/WebConsole/idiomas/javascripts/eng/propiedades_universidades_eng.js +++ b/admin/WebConsole/idiomas/javascripts/eng/propiedades_universidades_eng.js @@ -1,7 +1,7 @@ //________________________________________________________________________________________________________ // -// Fichero de idiomas javascript: propiedades_universidades_eng.js -// Idioma: Ings +// Javascript language file: propiedades_universidades_eng.js +// Language: English //________________________________________________________________________________________________________ TbMsg=new Array; -TbMsg[0]="You must introduce a name for this University"; +TbMsg[0]="You must enter a name for this University"; diff --git a/admin/WebConsole/idiomas/javascripts/eng/propiedades_usuarios_eng.js b/admin/WebConsole/idiomas/javascripts/eng/propiedades_usuarios_eng.js index 4d7151e4..04200171 100644 --- a/admin/WebConsole/idiomas/javascripts/eng/propiedades_usuarios_eng.js +++ b/admin/WebConsole/idiomas/javascripts/eng/propiedades_usuarios_eng.js @@ -1,13 +1,13 @@ //________________________________________________________________________________________________________ // -// Fichero de idiomas javascript: propiedades_usuarios_eng.js -// Idioma: Ings +// Javascript language file: propiedades_usuarios_eng.js +// Language: English //________________________________________________________________________________________________________ TbMsg=new Array; -TbMsg[0]="You must introduce an user"; -TbMsg[1]="You must introduce a password for this user"; -TbMsg[2]="You must introduce a complete name"; -TbMsg[3]="You must introduce an organizing unit for this user"; -TbMsg[4]="You must introduce a language"; -TbMsg[5]="Los campos 'Password' y 'Confirmar password' no coinciden"; -TbMsg[6]="La clave debe tener un mnimo de 8 caracteres"; +TbMsg[0]="You must enter user name"; +TbMsg[1]="You must enter a password for this user"; +TbMsg[2]="You must enter complete name"; +TbMsg[3]="You must enter organizational unit for this user"; +TbMsg[4]="You must enter language"; +TbMsg[5]="'Password' and 'Confirm password' does not match"; +TbMsg[6]="The key must be at least 8 characters"; diff --git a/admin/WebConsole/idiomas/javascripts/eng/reservas_eng.js b/admin/WebConsole/idiomas/javascripts/eng/reservas_eng.js index 890e7394..54457f61 100644 --- a/admin/WebConsole/idiomas/javascripts/eng/reservas_eng.js +++ b/admin/WebConsole/idiomas/javascripts/eng/reservas_eng.js @@ -1,7 +1,6 @@ //____________________________________________________________________________ // -// Fichero de idiomas javascript: reservas.js -// Idioma: Ings +// Javascript language file: reservas_eng.js +// Language: English //____________________________________________________________________________ TbMsg=new Array; - diff --git a/admin/WebConsole/idiomas/javascripts/eng/softwares_eng.js b/admin/WebConsole/idiomas/javascripts/eng/softwares_eng.js index 1f399ec5..4e3522ee 100644 --- a/admin/WebConsole/idiomas/javascripts/eng/softwares_eng.js +++ b/admin/WebConsole/idiomas/javascripts/eng/softwares_eng.js @@ -1,6 +1,6 @@ //____________________________________________________________________________ // -// Fichero de idiomas javascript: softwares.js -// Idioma: Ings +// Javascript language file: softwares_eng.js +// Language: English //____________________________________________________________________________ TbMsg=new Array; diff --git a/admin/WebConsole/idiomas/javascripts/eng/tareascomandos_eng.js b/admin/WebConsole/idiomas/javascripts/eng/tareascomandos_eng.js index d5cfa10d..7b9c146a 100644 --- a/admin/WebConsole/idiomas/javascripts/eng/tareascomandos_eng.js +++ b/admin/WebConsole/idiomas/javascripts/eng/tareascomandos_eng.js @@ -1,10 +1,10 @@ //____________________________________________________________________________ // // Fichero de idiomas javascript: tareascomandos_eng.js -// Idioma: Ings +// Idioma: Ingls //____________________________________________________________________________ TbMsg=new Array; -TbMsg[0]="WARNING.- This command will be excluded from task. Are you sure ?"; -TbMsg[1]="WARNING: You must introduce an order number"; -TbMsg[2]="This command has been successfully excluded from this task"; -TbMsg[3]="This commad has been successfully modified"; +TbMsg[0]="WARNING: This command will be excluded from this task. Are you sure?"; +TbMsg[1]="WARNING: You must enter a sequence number"; +TbMsg[2]="This command has been excluded successfully from this task"; +TbMsg[3]="This command has been modified successfully"; diff --git a/admin/WebConsole/idiomas/javascripts/eng/trabajostareas_eng.js b/admin/WebConsole/idiomas/javascripts/eng/trabajostareas_eng.js index dc334d71..7e2f92a7 100644 --- a/admin/WebConsole/idiomas/javascripts/eng/trabajostareas_eng.js +++ b/admin/WebConsole/idiomas/javascripts/eng/trabajostareas_eng.js @@ -1,10 +1,10 @@ //____________________________________________________________________________ // -// Fichero de idiomas javascript: trabajostareas_eng.js -// Idioma: Ings +// Javascript language file: trabajostareas_eng.js +// Language: English //____________________________________________________________________________ TbMsg=new Array; -TbMsg[0]="This task has been successfully included in this job"; -TbMsg[1]="WARNING: You must introduce an order number"; -TbMsg[2]="This task has been successfully excluded from this job"; -TbMsg[3]="This task has been successfully modified"; +TbMsg[0]="This task has been included successfully in this job"; +TbMsg[1]="WARNING: You must enter a sequence number"; +TbMsg[2]="This task has been excluded successfully from this job"; +TbMsg[3]="This task has been modified successfully"; diff --git a/admin/WebConsole/idiomas/javascripts/esp/avisos_esp.js b/admin/WebConsole/idiomas/javascripts/esp/avisos_esp.js new file mode 100644 index 00000000..9d1df6e0 --- /dev/null +++ b/admin/WebConsole/idiomas/javascripts/esp/avisos_esp.js @@ -0,0 +1,7 @@ +//____________________________________________________________________________ +// +// Fichero de idiomas javascript: avisos_esp.js +// Idioma: Español +//____________________________________________________________________________ +TbMsg=new Array; +TbMsg["WARN_NOREPO"]="No hay definido repositorio en la unidad organizativa, los ordenadores se darán de alta sin repositorio."; diff --git a/admin/WebConsole/idiomas/javascripts/esp/propiedades_repositorios_esp.js b/admin/WebConsole/idiomas/javascripts/esp/propiedades_repositorios_esp.js index 9145ffd8..8aa661dd 100644 --- a/admin/WebConsole/idiomas/javascripts/esp/propiedades_repositorios_esp.js +++ b/admin/WebConsole/idiomas/javascripts/esp/propiedades_repositorios_esp.js @@ -6,6 +6,6 @@ TbMsg=new Array; TbMsg[0]="El nombre del repositorio sólo puede contener caracteres alfanuméricos"; TbMsg[1]="Debe introducir una dirección IP"; -TbMsg[2]="ATENCIÓN: Hay imágenes alojadas por este repositorio. ¿Está seguro de querer eliminarlo ?"; +TbMsg[2]="ATENCIÓN: Hay ordenadores asignados a este repositorio. ¿Está seguro de querer eliminarlo ?"; TbMsg[3]="Debe introducir un puerto de comunicaciones para los clientes"; TbMsg[4]="Los comentarios sólo pueden contener caracteres alfanuméricos"; diff --git a/admin/WebConsole/idiomas/php/cat/acceso_cat.php b/admin/WebConsole/idiomas/php/cat/acceso_cat.php index 1b29d068..747c4047 100644 --- a/admin/WebConsole/idiomas/php/cat/acceso_cat.php +++ b/admin/WebConsole/idiomas/php/cat/acceso_cat.php @@ -30,5 +30,4 @@ $TbMsg["ACCESS_ALLOWED"]='Accés permès. Esperi si us plau ...'; $TbMsg["ACCESS_ERROR"]='Error d\'acces'; $TbMsg["ACCESS_UNKNOWNERROR"]='Error desconegut'; $TbMsg["ACCESS_NOFRAMES"]='El navegador necessita suport per a "frames" per a mostrar la pàgina.'; -?> - +$TbMsg["WARN_NOREPO"]='No existe repositorio definido en la Unidad Organizativa'; diff --git a/admin/WebConsole/idiomas/php/cat/ayuda_cat.php b/admin/WebConsole/idiomas/php/cat/ayuda_cat.php new file mode 100644 index 00000000..40607de3 --- /dev/null +++ b/admin/WebConsole/idiomas/php/cat/ayuda_cat.php @@ -0,0 +1,19 @@ +<?php +// __________________________________________________ +// +// Fichero de idiomas php: ayuda_cat.php +// Idioma: Catalán +// __________________________________________________ +// Mensajes. +$TbMsg=array(); +$TbMsg["HELP_TITLE"]='Ayuda'; +$TbMsg["MANUAL"]='Manual de usuario'; +$TbMsg["API"]='Documentación de la API'; +$TbMsg["CFG"]='Configuración de los clientes'; +$TbMsg["CHANGELOG"]='Cambios en la versión:'; +$TbMsg["USERMAIL"]='Lista de correos de usuarios'; +$TbMsg["WEB"]='Web del proyecto: opengnsys.es'; +$TbMsg["ABOUT"]='Acerca de OpenGnsys'; +$TbMsg["CHANGELOG_TITLE"]='Cambios en la versión: '; +$TbMsg["ENGINE_TITLE"]='Configuración de los clientes'; +$TbMsg["ENGINE_SUBTITLE"]='Contenido de engine.cfg'; diff --git a/admin/WebConsole/idiomas/php/cat/barramenu_cat.php b/admin/WebConsole/idiomas/php/cat/barramenu_cat.php index 338ebb32..27c54de3 100644 --- a/admin/WebConsole/idiomas/php/cat/barramenu_cat.php +++ b/admin/WebConsole/idiomas/php/cat/barramenu_cat.php @@ -21,7 +21,3 @@ $TbMsg[14]='Cercar'; $TbMsg[15]='Netboot Avançat'; $TbMsg[16]='Unitat Organitzativa'; - $TbMsg[17]='Acerca de'; - -?> - diff --git a/admin/WebConsole/idiomas/php/cat/buscar_cat.php b/admin/WebConsole/idiomas/php/cat/buscar_cat.php index 08314d0c..5c7ff062 100644 --- a/admin/WebConsole/idiomas/php/cat/buscar_cat.php +++ b/admin/WebConsole/idiomas/php/cat/buscar_cat.php @@ -16,5 +16,6 @@ $TbMsg["SEARCH_DUPLICATES"]="Duplicats"; $TbMsg["SEARCH_NOMATCHES"]="No es troben resultats"; $TbMsg["SEARCH_NOVALUE"]="Ha d\'introduir un valor pel criteri de cerca"; $TbMsg["SEARCH_PROFESSOR"]="Ordenadores de profesor"; +$TbMsg["SEARCH_NOREPO"]="Ordenadores sin repositorio"; ?> diff --git a/admin/WebConsole/idiomas/php/cat/changelog_cat.php b/admin/WebConsole/idiomas/php/cat/changelog_cat.php new file mode 100644 index 00000000..904d217c --- /dev/null +++ b/admin/WebConsole/idiomas/php/cat/changelog_cat.php @@ -0,0 +1,9 @@ +<?php +// __________________________________________________ +// +// Fichero de idiomas php: changelog_esp.php +// Idioma: Español +// __________________________________________________ +// Mensajes. +$TbMsg=array(); +$TbMsg["CHANGELOG_TITULO"]='Cambios en la versión: '; diff --git a/admin/WebConsole/idiomas/php/cat/comandos/crearimagen_cat.php b/admin/WebConsole/idiomas/php/cat/comandos/crearimagen_cat.php index db4e1f00..624757e4 100644 --- a/admin/WebConsole/idiomas/php/cat/comandos/crearimagen_cat.php +++ b/admin/WebConsole/idiomas/php/cat/comandos/crearimagen_cat.php @@ -1,7 +1,7 @@ <?php //________________________________________________________________________________________________________ // -// Fichero de idiomas php: crearperfilsoftware_cat.php (Comandos) +// Fichero de idiomas php: crearimagen_cat.php (Comandos) // Idioma: Català //________________________________________________________________________________________________________ $TbMsg=array(); @@ -21,4 +21,4 @@ $TbMsg[13]='Tipus'; $TbMsg[14]='Àmbit'; $TbMsg[15]='Ordinadors'; -?> + $TbMsg["CREATE_NOREPO"]='<br> Ordenador sin repositorio asignado. <br>No se puede crear imagen.<br> '; diff --git a/admin/WebConsole/idiomas/php/cat/engine_cat.php b/admin/WebConsole/idiomas/php/cat/engine_cat.php new file mode 100644 index 00000000..90b438f8 --- /dev/null +++ b/admin/WebConsole/idiomas/php/cat/engine_cat.php @@ -0,0 +1,10 @@ +<?php +// __________________________________________________ +// +// Fichero de idiomas php: engine_esp.php +// Idioma: Español +// __________________________________________________ +// Mensajes. +$TbMsg=array(); +$TbMsg["ENGINE_TITULO"]='Configuración de los clientes'; +$TbMsg["ENGINE_SUBTITULO"]='Contenido de engine.cfg'; diff --git a/admin/WebConsole/idiomas/php/cat/imagenes_cat.php b/admin/WebConsole/idiomas/php/cat/imagenes_cat.php index 0cbc73d1..0cd06da4 100644 --- a/admin/WebConsole/idiomas/php/cat/imagenes_cat.php +++ b/admin/WebConsole/idiomas/php/cat/imagenes_cat.php @@ -19,4 +19,4 @@ $TbMsg[11]='"Imagenes Monoliticas"'; $TbMsg[12]='"Imagenes Basicas"'; $TbMsg[13]='"Imagenes Incrementales"'; -?> + $TbMsg["DELETEDREPO"]='Repositorio eliminado'; diff --git a/admin/WebConsole/idiomas/php/cat/propiedades_ordenadores_cat.php b/admin/WebConsole/idiomas/php/cat/propiedades_ordenadores_cat.php index bd8181ed..d4e1a97b 100644 --- a/admin/WebConsole/idiomas/php/cat/propiedades_ordenadores_cat.php +++ b/admin/WebConsole/idiomas/php/cat/propiedades_ordenadores_cat.php @@ -2,22 +2,22 @@ //____________________________________________________________ // // Fitxer d'idiomes php: propiedades_ordenadores_cat.php -// Idioma: Catal� +// Idioma: Català //____________________________________________________________ if (empty ($TbMsg)) $TbMsg=array(); -$TbMsg[0]="Sense Opci�"; +$TbMsg[0]="Sense Opció"; $TbMsg[1]="Afegir"; $TbMsg[2]="Modificar"; $TbMsg[3]="Eliminar"; -$TbMsg[4]="Gesti� Ordinadors"; +$TbMsg[4]="Gestió Ordinadors"; $TbMsg[5]="Nom"; -$TbMsg[6]="Direcci� IP"; -$TbMsg[7]="Direcci� MAC"; +$TbMsg[6]="Direcció IP"; +$TbMsg[7]="Direcció MAC"; $TbMsg[8]="Perfil Hardware"; $TbMsg[9]="Autoexec"; $TbMsg[10]="Repositori"; -$TbMsg[11]="Men�"; -$TbMsg[12]="Grand�ria Cach�"; +$TbMsg[11]="Menú"; +$TbMsg[12]="Grandéria Caché"; $TbMsg[13]="Interficie de Xarxa"; $TbMsg[14]="Driver de Xarxa"; // AGP @@ -25,13 +25,11 @@ $TbMsg[18]="ogLive"; $TbMsg[509]="Foto ordinador"; $TbMsg[5091]="Afegir foto"; $TbMsg[5092]="Veure fotos"; -$TbMsg[495]="Data/Cach�"; -$TbMsg[4951]="Cach� lliure"; +$TbMsg[495]="Data/Caché"; +$TbMsg[4951]="Caché lliure"; // AGP +$TbMsg['COMM_DEFOGLIVE']="Assignat per l'administrador"; $TbMsg["PROP_SERIALNO"]="Nº de serie"; +$TbMsg["WARN_NOTREPO"]="<em>AVISO: sin repositorio asignado.</em>"; $TbMsg["WARN_NOTDETECTED"]="<em>(no detectado)</em>"; -$TbMsg['COMM_DEFOGLIVE']="Assignat per l'administrador"; -// Ticket-816 PCprofesor $TbMsg['WARN_PROFESSOR']="profesor"; -?> - diff --git a/admin/WebConsole/idiomas/php/cat/propiedades_repositorios_cat.php b/admin/WebConsole/idiomas/php/cat/propiedades_repositorios_cat.php index 9d76b2be..d71d1200 100644 --- a/admin/WebConsole/idiomas/php/cat/propiedades_repositorios_cat.php +++ b/admin/WebConsole/idiomas/php/cat/propiedades_repositorios_cat.php @@ -1,10 +1,10 @@ <?php //________________________________________________________________________________________________________ // -// Fichero de idiomas php: propiedades_servidoresrembo_cat.php +// Fichero de idiomas php: propiedades_repositorios_cat.php // Idioma: Català //________________________________________________________________________________________________________ -$TbMsg=array(); +if (empty ($TbMsg)) $TbMsg=array(); $TbMsg[0]="Sense Opció"; $TbMsg[1]="Afegir"; $TbMsg[2]="Modificar"; @@ -13,7 +13,7 @@ $TbMsg[4]="Gestió Repositoris"; $TbMsg[5]="Nom del Repositori"; $TbMsg[6]="Direcció IP"; $TbMsg[7]="Comentaris"; -$TbMsg[8]="Port"; + $TbMsg[9]="Directori Base"; $TbMsg[10]="Directori PXE"; $TbMsg[11]="Espai TOTAL"; @@ -29,4 +29,3 @@ $TbMsg['MSG_TYPE']='Tipo'; $TbMsg['MSG_SIZE']='Tamaño'; $TbMsg['MSG_MODIFIED']='Modificado'; $TbMsg['MSG_PERMISSIONS']='Permisos'; -?> diff --git a/admin/WebConsole/idiomas/php/eng/acceso_eng.php b/admin/WebConsole/idiomas/php/eng/acceso_eng.php index d50a0003..a788a712 100644 --- a/admin/WebConsole/idiomas/php/eng/acceso_eng.php +++ b/admin/WebConsole/idiomas/php/eng/acceso_eng.php @@ -30,3 +30,4 @@ $TbMsg["ACCESS_ALLOWED"]='Access allowed. Please wait ...'; $TbMsg["ACCESS_ERROR"]='Access error'; $TbMsg["ACCESS_UNKNOWNERROR"]='Unknown error'; $TbMsg["ACCESS_NOFRAMES"]='Sorry, your browser does not handle frames.'; +$TbMsg["WARN_NOREPO"]='There is no repository defined in the Organizational Unit.'; diff --git a/admin/WebConsole/idiomas/php/eng/ayuda_eng.php b/admin/WebConsole/idiomas/php/eng/ayuda_eng.php new file mode 100644 index 00000000..f0da7af5 --- /dev/null +++ b/admin/WebConsole/idiomas/php/eng/ayuda_eng.php @@ -0,0 +1,19 @@ +<?php +// __________________________________________________ +// +// Fichero de idiomas php: ayuda_eng.php +// Idioma: Inglés +// __________________________________________________ +// Mensajes. +$TbMsg=array(); +$TbMsg["HELP_TITLE"]='Help'; +$TbMsg["MANUAL"]='User Manual'; +$TbMsg["API"]='API documentation'; +$TbMsg["CFG"]='Client configuration'; +$TbMsg["CHANGELOG"]='Changes in the version:'; +$TbMsg["USERMAIL"]=' User email list'; +$TbMsg["WEB"]='Web of the project: opengnsys.es'; +$TbMsg["ABOUT"]='About OpenGnsys'; +$TbMsg["CHANGELOG_TITLE"]='Changes in the version: '; +$TbMsg["ENGINE_TITLE"]='Client configuration'; +$TbMsg["ENGINE_SUBTITLE"]='Content of engine.cfg'; diff --git a/admin/WebConsole/idiomas/php/eng/barramenu_eng.php b/admin/WebConsole/idiomas/php/eng/barramenu_eng.php index 66fb6173..faf0d422 100644 --- a/admin/WebConsole/idiomas/php/eng/barramenu_eng.php +++ b/admin/WebConsole/idiomas/php/eng/barramenu_eng.php @@ -21,4 +21,3 @@ $TbMsg[14]='Search'; $TbMsg[15]='Advanced Netboot'; $TbMsg[16]='Organizational Unit'; - $TbMsg[17]='About'; diff --git a/admin/WebConsole/idiomas/php/eng/buscar_eng.php b/admin/WebConsole/idiomas/php/eng/buscar_eng.php index 8d069840..7ac01d32 100644 --- a/admin/WebConsole/idiomas/php/eng/buscar_eng.php +++ b/admin/WebConsole/idiomas/php/eng/buscar_eng.php @@ -16,4 +16,4 @@ $TbMsg["SEARCH_DUPLICATES"]="Duplicates"; $TbMsg["SEARCH_NOMATCHES"]="No matches"; $TbMsg["SEARCH_NOVALUE"]="You must enter a search criteria value."; $TbMsg["SEARCH_PROFESSOR"]="Professor's computers"; - +$TbMsg["SEARCH_NOREPO"]="Computers without repository"; diff --git a/admin/WebConsole/idiomas/php/eng/changelog_eng.php b/admin/WebConsole/idiomas/php/eng/changelog_eng.php new file mode 100644 index 00000000..f7106fff --- /dev/null +++ b/admin/WebConsole/idiomas/php/eng/changelog_eng.php @@ -0,0 +1,9 @@ +<?php +// __________________________________________________ +// +// Fichero de idiomas php: changelog_esp.php +// Idioma: Español +// __________________________________________________ +// Mensajes. +$TbMsg=array(); +$TbMsg["CHANGELOG_TITULO"]='Changes in the version: '; diff --git a/admin/WebConsole/idiomas/php/eng/comandos/crearimagen_eng.php b/admin/WebConsole/idiomas/php/eng/comandos/crearimagen_eng.php index 2daa8722..833155f1 100644 --- a/admin/WebConsole/idiomas/php/eng/comandos/crearimagen_eng.php +++ b/admin/WebConsole/idiomas/php/eng/comandos/crearimagen_eng.php @@ -21,3 +21,4 @@ $TbMsg[13]='Type'; $TbMsg[14]='Scope'; $TbMsg[15]='Computers'; + $TbMsg["CREATE_NOREPO"]='<br> Computer whithout repository assigned. <br>Can not create image.<br> '; diff --git a/admin/WebConsole/idiomas/php/eng/engine_eng.php b/admin/WebConsole/idiomas/php/eng/engine_eng.php new file mode 100644 index 00000000..64a1df6a --- /dev/null +++ b/admin/WebConsole/idiomas/php/eng/engine_eng.php @@ -0,0 +1,10 @@ +<?php +// __________________________________________________ +// +// Fichero de idiomas php: engine_esp.php +// Idioma: Español +// __________________________________________________ +// Mensajes. +$TbMsg=array(); +$TbMsg["ENGINE_TITULO"]='Client configuration'; +$TbMsg["ENGINE_SUBTITULO"]='Content of engine.cfg'; diff --git a/admin/WebConsole/idiomas/php/eng/imagenes_eng.php b/admin/WebConsole/idiomas/php/eng/imagenes_eng.php index 9b9a3119..d19754c2 100644 --- a/admin/WebConsole/idiomas/php/eng/imagenes_eng.php +++ b/admin/WebConsole/idiomas/php/eng/imagenes_eng.php @@ -19,3 +19,4 @@ $TbMsg[11]='"Monolithic Images"'; $TbMsg[12]='"Base Images"'; $TbMsg[13]='"Incremental Images"'; + $TbMsg["DELETEDREPO"]='Deleted Repository'; diff --git a/admin/WebConsole/idiomas/php/eng/propiedades_aulas_eng.php b/admin/WebConsole/idiomas/php/eng/propiedades_aulas_eng.php index 8841a2ee..f308484e 100644 --- a/admin/WebConsole/idiomas/php/eng/propiedades_aulas_eng.php +++ b/admin/WebConsole/idiomas/php/eng/propiedades_aulas_eng.php @@ -58,4 +58,4 @@ $TbMsg['PROP_REMOTEACCESS']="Remote access"; $TbMsg['COMM_REMOTEACCESS']="allow remote access management to computers"; $TbMsg['COMM_DEFOGLIVE']="Assigned by administrator"; // Ticket-816 PCprofesor -$TbMsg['PROP_PROFCOMPUTER']="Professor's computer"; +$TbMsg['PROP_PROFCOMPUTER']="Teacher‘s computer", diff --git a/admin/WebConsole/idiomas/php/eng/propiedades_ordenadores_eng.php b/admin/WebConsole/idiomas/php/eng/propiedades_ordenadores_eng.php index 4b748df7..0a18d8a4 100644 --- a/admin/WebConsole/idiomas/php/eng/propiedades_ordenadores_eng.php +++ b/admin/WebConsole/idiomas/php/eng/propiedades_ordenadores_eng.php @@ -27,8 +27,8 @@ $TbMsg[5092]="View pictures"; $TbMsg[495]="Content Cache"; $TbMsg[4951]="Cache Free"; // AGP +$TbMsg['COMM_DEFOGLIVE']="Assigned by administrator"; $TbMsg["PROP_SERIALNO"]="Serial No."; +$TbMsg["WARN_NOREPO"]="<em>WARNING: no repository assigned.</em>"; $TbMsg["WARN_NOTDETECTED"]="<em>(not detected)</em>"; -$TbMsg['COMM_DEFOGLIVE']="Assigned by administrator"; -// Ticket-816 PCprofesor -$TbMsg['WARN_PROFESSOR']="professor"; +$TbMsg['WARN_PROFESSOR']="teacher"; diff --git a/admin/WebConsole/idiomas/php/eng/propiedades_repositorios_eng.php b/admin/WebConsole/idiomas/php/eng/propiedades_repositorios_eng.php index 8bee9e3f..0abe1c52 100644 --- a/admin/WebConsole/idiomas/php/eng/propiedades_repositorios_eng.php +++ b/admin/WebConsole/idiomas/php/eng/propiedades_repositorios_eng.php @@ -4,7 +4,7 @@ // Php language file: propiedades_repositorios_eng.php // Language: English //________________________________________________________________________________________________________ -$TbMsg=array(); +if (empty ($TbMsg)) $TbMsg=array(); $TbMsg[0]="No Option"; $TbMsg[1]="Insert"; $TbMsg[2]="Change"; @@ -13,7 +13,7 @@ $TbMsg[4]="Repository management"; $TbMsg[5]="Repository name"; $TbMsg[6]="IP address"; $TbMsg[7]="Comments"; -$TbMsg[8]="Port"; + $TbMsg[9]="Base Directory"; $TbMsg[10]="PXE Directory"; $TbMsg[11]="TOTAL space"; diff --git a/admin/WebConsole/idiomas/php/esp/acceso_esp.php b/admin/WebConsole/idiomas/php/esp/acceso_esp.php index e5d084f5..ece7487b 100644 --- a/admin/WebConsole/idiomas/php/esp/acceso_esp.php +++ b/admin/WebConsole/idiomas/php/esp/acceso_esp.php @@ -30,4 +30,4 @@ $TbMsg["ACCESS_ALLOWED"]='Acceso permitido. Espere por favor ...'; $TbMsg["ACCESS_ERROR"]='Error de acceso'; $TbMsg["ACCESS_UNKNOWNERROR"]='Error desconocido'; $TbMsg["ACCESS_NOFRAMES"]='El navegador necesita soporte para "frames" para mostrar la página.'; -?> +$TbMsg["WARN_NOREPO"]='No existe repositorio definido en la Unidad Organizativa.'; diff --git a/admin/WebConsole/idiomas/php/esp/ayuda_esp.php b/admin/WebConsole/idiomas/php/esp/ayuda_esp.php new file mode 100644 index 00000000..b45d1da7 --- /dev/null +++ b/admin/WebConsole/idiomas/php/esp/ayuda_esp.php @@ -0,0 +1,19 @@ +<?php +// __________________________________________________ +// +// Fichero de idiomas php: ayuda_esp.php +// Idioma: Español +// __________________________________________________ +// Mensajes. +$TbMsg=array(); +$TbMsg["HELP_TITLE"]='Ayuda'; +$TbMsg["MANUAL"]='Manual de usuario'; +$TbMsg["API"]='Documentación de la API'; +$TbMsg["CFG"]='Configuración de los clientes'; +$TbMsg["CHANGELOG"]='Cambios en la versión:'; +$TbMsg["USERMAIL"]='Lista de correos de usuarios'; +$TbMsg["WEB"]='Web del proyecto: opengnsys.es'; +$TbMsg["ABOUT"]='Acerca de OpenGnsys'; +$TbMsg["CHANGELOG_TITLE"]='Cambios en la versión: '; +$TbMsg["ENGINE_TITLE"]='Configuración de los clientes'; +$TbMsg["ENGINE_SUBTITLE"]='Contenido de engine.cfg'; diff --git a/admin/WebConsole/idiomas/php/esp/barramenu_esp.php b/admin/WebConsole/idiomas/php/esp/barramenu_esp.php index 1ea51290..6d863015 100644 --- a/admin/WebConsole/idiomas/php/esp/barramenu_esp.php +++ b/admin/WebConsole/idiomas/php/esp/barramenu_esp.php @@ -21,6 +21,5 @@ $TbMsg[14]='Buscar'; $TbMsg[15]='Netboot Avanzado'; $TbMsg[16]='Unidad Organizativa'; - $TbMsg[17]='Acerca de'; ?> diff --git a/admin/WebConsole/idiomas/php/esp/buscar_esp.php b/admin/WebConsole/idiomas/php/esp/buscar_esp.php index ec5de480..82281b92 100644 --- a/admin/WebConsole/idiomas/php/esp/buscar_esp.php +++ b/admin/WebConsole/idiomas/php/esp/buscar_esp.php @@ -16,5 +16,6 @@ $TbMsg["SEARCH_DUPLICATES"]="Duplicados"; $TbMsg["SEARCH_NOMATCHES"]="No se encuentran resultados"; $TbMsg["SEARCH_NOVALUE"]="Debe introducir un valor para el criterio de búsqueda"; $TbMsg["SEARCH_PROFESSOR"]="Ordenadores de profesor"; +$TbMsg["SEARCH_NOREPO"]="Ordenadores sin repositorio"; ?> diff --git a/admin/WebConsole/idiomas/php/esp/changelog_esp.php b/admin/WebConsole/idiomas/php/esp/changelog_esp.php new file mode 100644 index 00000000..904d217c --- /dev/null +++ b/admin/WebConsole/idiomas/php/esp/changelog_esp.php @@ -0,0 +1,9 @@ +<?php +// __________________________________________________ +// +// Fichero de idiomas php: changelog_esp.php +// Idioma: Español +// __________________________________________________ +// Mensajes. +$TbMsg=array(); +$TbMsg["CHANGELOG_TITULO"]='Cambios en la versión: '; diff --git a/admin/WebConsole/idiomas/php/esp/comandos/crearimagen_esp.php b/admin/WebConsole/idiomas/php/esp/comandos/crearimagen_esp.php index 4dfbd433..8826611d 100644 --- a/admin/WebConsole/idiomas/php/esp/comandos/crearimagen_esp.php +++ b/admin/WebConsole/idiomas/php/esp/comandos/crearimagen_esp.php @@ -1,7 +1,7 @@ <?php //________________________________________________________________________________________________________ // -// Fichero de idiomas php: crearperfilsoftware_esp.php (Comandos) +// Fichero de idiomas php: crearimagen_esp.php (Comandos) // Idioma: Español //________________________________________________________________________________________________________ $TbMsg=array(); @@ -21,4 +21,4 @@ $TbMsg[13]='Tipo'; $TbMsg[14]='Ámbito'; $TbMsg[15]='Ordenadores'; -?> + $TbMsg["CREATE_NOREPO"]='<br> Ordenador sin repositorio asignado. <br>No se puede crear imagen.<br> '; diff --git a/admin/WebConsole/idiomas/php/esp/engine_esp.php b/admin/WebConsole/idiomas/php/esp/engine_esp.php new file mode 100644 index 00000000..90b438f8 --- /dev/null +++ b/admin/WebConsole/idiomas/php/esp/engine_esp.php @@ -0,0 +1,10 @@ +<?php +// __________________________________________________ +// +// Fichero de idiomas php: engine_esp.php +// Idioma: Español +// __________________________________________________ +// Mensajes. +$TbMsg=array(); +$TbMsg["ENGINE_TITULO"]='Configuración de los clientes'; +$TbMsg["ENGINE_SUBTITULO"]='Contenido de engine.cfg'; diff --git a/admin/WebConsole/idiomas/php/esp/imagenes_esp.php b/admin/WebConsole/idiomas/php/esp/imagenes_esp.php index 59dc3493..507a894a 100644 --- a/admin/WebConsole/idiomas/php/esp/imagenes_esp.php +++ b/admin/WebConsole/idiomas/php/esp/imagenes_esp.php @@ -19,4 +19,4 @@ $TbMsg[11]='"Imágenes Monolíticas"'; $TbMsg[12]='"Imágenes Básicas"'; $TbMsg[13]='"Imágenes Incrementales"'; -?> + $TbMsg["DELETEDREPO"]='Repositorio eliminado'; diff --git a/admin/WebConsole/idiomas/php/esp/propiedades_ordenadores_esp.php b/admin/WebConsole/idiomas/php/esp/propiedades_ordenadores_esp.php index 98f1fc91..be2bbb93 100644 --- a/admin/WebConsole/idiomas/php/esp/propiedades_ordenadores_esp.php +++ b/admin/WebConsole/idiomas/php/esp/propiedades_ordenadores_esp.php @@ -33,10 +33,8 @@ $TbMsg[5092]="Ver fotos"; $TbMsg[495]="Fecha/Caché"; $TbMsg[4951]="Caché libre"; //AGP +$TbMsg['COMM_DEFOGLIVE']="Asignado por el administrador"; $TbMsg["PROP_SERIALNO"]="Nº de serie"; +$TbMsg["WARN_NOREPO"]="<em>AVISO: sin repositorio asignado.</em>"; $TbMsg["WARN_NOTDETECTED"]="<em>(no detectado)</em>"; -$TbMsg['COMM_DEFOGLIVE']="Asignado por el administrador"; -// Ticket-816 PCprofesor $TbMsg['WARN_PROFESSOR']="profesor"; -?> - diff --git a/admin/WebConsole/idiomas/php/esp/propiedades_repositorios_esp.php b/admin/WebConsole/idiomas/php/esp/propiedades_repositorios_esp.php index 76a10548..e01e657b 100644 --- a/admin/WebConsole/idiomas/php/esp/propiedades_repositorios_esp.php +++ b/admin/WebConsole/idiomas/php/esp/propiedades_repositorios_esp.php @@ -1,10 +1,10 @@ <?php //________________________________________________________________________________________________________ // -// Fichero de idiomas php: propiedades_servidoresrembo_esp.php +// Fichero de idiomas php: propiedades_repositorios_esp.php // Idioma: Español //________________________________________________________________________________________________________ -$TbMsg=array(); +if (empty ($TbMsg)) $TbMsg=array(); $TbMsg[0]="Sin Opción"; $TbMsg[1]="Insertar"; $TbMsg[2]="Modificar"; @@ -13,7 +13,7 @@ $TbMsg[4]="Gestión Repositorios"; $TbMsg[5]="Nombre del Repositorio"; $TbMsg[6]="Dirección IP"; $TbMsg[7]="Comentarios"; -$TbMsg[8]="Puerto"; + $TbMsg[9]="Directorio Base"; $TbMsg[10]="Directorio PXE"; $TbMsg[11]="Espacio TOTAL"; @@ -29,4 +29,3 @@ $TbMsg['MSG_TYPE']='Tipo'; $TbMsg['MSG_SIZE']='Tamaño'; $TbMsg['MSG_MODIFIED']='Modificado'; $TbMsg['MSG_PERMISSIONS']='Permisos'; -?> diff --git a/admin/WebConsole/includes/tftputils.php b/admin/WebConsole/includes/tftputils.php index e7af641f..5cf2da88 100644 --- a/admin/WebConsole/includes/tftputils.php +++ b/admin/WebConsole/includes/tftputils.php @@ -84,7 +84,7 @@ function createBootMode ($cmd, $bootopt, $hostid, $lang) { ordenadores.oglivedir AS oglivedir, aulas.netmask AS netmask, aulas.router AS router, aulas.ntp AS ntp, aulas.dns AS dns, aulas.proxy AS proxy, - aulas.nombreaula AS grupo, repositorios.ip AS iprepo, + aulas.nombreaula AS grupo, IFNULL(repositorios.ip, '') AS iprepo, (SELECT ipserveradm FROM entornos LIMIT 1) AS ipserveradm, menus.resolucion AS vga, perfileshard.descripcion AS hardprofile, centros.directorio, entidades.ogunit @@ -92,7 +92,7 @@ function createBootMode ($cmd, $bootopt, $hostid, $lang) { JOIN aulas USING (idaula) JOIN centros USING (idcentro) JOIN entidades USING (identidad) - JOIN repositorios USING (idrepositorio) + LEFT JOIN repositorios USING (idrepositorio) LEFT JOIN menus USING (idmenu) LEFT JOIN perfileshard USING (idperfilhard) WHERE ordenadores.idordenador='$hostid'"; @@ -277,6 +277,3 @@ function updateBootRepo ($cmd, $repoid) { } return($errors); } - -?> - diff --git a/admin/WebConsole/jscripts/propiedades_ordenadores.js b/admin/WebConsole/jscripts/propiedades_ordenadores.js index f42c309f..ff7c3c7a 100644 --- a/admin/WebConsole/jscripts/propiedades_ordenadores.js +++ b/admin/WebConsole/jscripts/propiedades_ordenadores.js @@ -96,6 +96,5 @@ function comprobar_datos(){ validate (form.nombreordenador, validate_text_notnull, 0) && validate (form.ip, validate_ipadress_notnull, 1) && validate (form.mac, validate_macaddress_notnull, 2) && - validate (form.numserie, validate_alphanum, 3) && - validate (form.idrepositorio, validate_number_notnull, 5) ; + validate (form.numserie, validate_alphanum, 3) ; } diff --git a/admin/WebConsole/jscripts/propiedades_repositorios.js b/admin/WebConsole/jscripts/propiedades_repositorios.js index 74164716..f74fea61 100644 --- a/admin/WebConsole/jscripts/propiedades_repositorios.js +++ b/admin/WebConsole/jscripts/propiedades_repositorios.js @@ -91,7 +91,6 @@ function comprobar_datos(){ // Validación general de datos del formulario. return validate (fdatos.nombrerepositorio, validate_text_notnull, 0 ) && validate (fdatos.ip, validate_ipadress_notnull, 1 ) && - validate (fdatos.puertorepo, validate_number_notnull, 3 ) && validate (fdatos.comentarios, validate_text, 4 ); } diff --git a/admin/WebConsole/nada.php b/admin/WebConsole/nada.php index 84e7b490..9e0aa255 100644 --- a/admin/WebConsole/nada.php +++ b/admin/WebConsole/nada.php @@ -221,4 +221,19 @@ if (empty($data->project)) { </body> </html> +<?php } else { ?> + +<html> +<head> + <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> + <link rel="stylesheet" type="text/css" href="./estilos.css"> +</head> +<body> + +"Here we will show our content" + +</body> +</html> + <?php } ?> + diff --git a/admin/WebConsole/principal/acercade.php b/admin/WebConsole/principal/acercade.php index f95e07c1..3581b977 100644 --- a/admin/WebConsole/principal/acercade.php +++ b/admin/WebConsole/principal/acercade.php @@ -35,95 +35,6 @@ if (empty($data->project)) { } ?> </p> -<?php -// Añadir CHANGELOG. -$buschangelog=exec('ls ../../doc | grep CHANGELOG*', $nombrechange); -$changelogfile="../../doc/".$buschangelog; -?> -<?php -// Añadir Manual. -$usermanual="../../doc/userManual"; -$destdir="../api/userManual"; -if (file_exists ($usermanual)){ -// Copiamos el directorio userManual -system("rm -fr $destdir; cp -a $usermanual $destdir"); -// Creamos el Inicio del Manual -// Añadimos instrucciones -$ficheroinicio="$destdir/Inicio.php"; -system("touch $ficheroinicio"); - -$crearficheroinicio=fopen($ficheroinicio,"w"); -fwrite($crearficheroinicio," -<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN' 'http://www.w3.org/TR/html4/loose.dtd'> -<html> -<head> -<title> Administración web de aulas </title> -<meta http-equiv='Content-Type' content='text/html;charset=UTF-8'> -<link rel='stylesheet' type='text/css' href='../estilos.css' /> -</head> - -<body class='acercade'> -<table width='100%' border='0'> - <tr> - <td width='30%'><p><img src='../../images/acercade.png' alt='*' hspace='10em' vspace='10em' align='left' /></p> - <p> </p> - <p> </p> - <p> </p> - <p> </p> - <p><img alt='OpenGnsys' src='../../images/iconos/logoopengnsys.png' /></p></td> - <td width='61%'> - -<p> - - - -<?php -\$directorio = opendir('.'); //ruta actual -while (\$archivo = readdir(\$directorio)) //obtenemos un archivo y luego otro sucesivamente -{ - if (is_dir(\$archivo))//verificamos si es o no un directorio - { - if (\$archivo == '.' || \$archivo == '..') - {}else{ - echo '['.\$archivo . ']<br />'; //de ser un directorio lo envolvemos entre corchetes - } - } - else - { - if (\$archivo == 'Inicio.php' || \$archivo == '.' || \$archivo == '..') - {}else{ - \$fichero[] = \$archivo; - } - } -} -sort(\$fichero); -foreach (\$fichero as \$ficheros) { - echo '<P><a href='.\$ficheros.' target=miframeflotante >'.\$ficheros.'</a></P>'; -} - -?> - - </td> - </tr> - -</table> - -<table width='100%' height='100%' border='0'> - <tr > - <td align='center' > - <?php echo '<iframe id=miframeflotante name=miframeflotante src='.\$fichero[0].' width=100% height=700 frameborder=0 scrolling=no marginwidth=0 marginheight=0 align=left>Tu navegador no soporta frames!!</iframe>'; - ?> - </td> - </tr> -</table> -"); -fclose($crearficheroinicio); - - -} -?> - - <p><strong><?php echo $TbMsg["TITLE"] ?></strong></p> @@ -131,21 +42,5 @@ fclose($crearficheroinicio); <p><?php echo $TbMsg["LICENSE"] ?> <a href="https://www.gnu.org/licenses/gpl.html" target="_blank" ><img alt="GPL v3" src="../images/gplv3-88x31.png" height="20em" /></a></p> -<p><?php - if (file_exists ($changelogfile)){ - system("cp ../../doc/$buschangelog ../api"); - echo "<strong><a href='../api/$buschangelog' target='_blank'>".$TbMsg["CHANGE"]."</a></strong>" - .@$data->project.' '.@$data->version.' '.(isset($data->codename)?'('.$data->codename.')':''); - } -?></p> - -<p><?php echo "<strong><a href='$ficheroinicio' target='_blank'>".$TbMsg["MANUAL"]."</a></strong>";?></p> - -<p><strong><?php echo $TbMsg["LINK"]; ?> <a href="https://opengnsys.es" target="_blank" >opengnsys.es</a><strong></p> - - - - - </body> </html> diff --git a/admin/WebConsole/principal/ayuda.php b/admin/WebConsole/principal/ayuda.php new file mode 100644 index 00000000..b5380e5c --- /dev/null +++ b/admin/WebConsole/principal/ayuda.php @@ -0,0 +1,38 @@ +<?php +//******************************************************************** +// Descripción : +// Pagina de ayuda +//******************************************************************** +include_once("../includes/ctrlacc.php"); +include_once("../idiomas/php/".$idioma."/ayuda_".$idioma.".php"); + +// Añadir versión. +$data = json_decode(@file_get_contents('../../doc/VERSION.json')); +$version=(empty($data->project)) ? "OpenGnsys" : @$data->project.' '.@$data->version.' '.(isset($data->codename) ? '('.$data->codename.') ' : '').@$data->release;; +?> + +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html> +<head> +<title> Administración web de aulas </title> +<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> +<link rel="stylesheet" type="text/css" href="../estilos.css" /> +</head> + +<body> + +<div><p align=center class=cabeceras><img border=0 nod="aulas-1" value="Sala Virtual" style="cursor:pointer" src="../images/iconos/logocirculos.png" > <?php echo $TbMsg["HELP_TITLE"]; ?></p> +</div> + +<div style="margin-left: 20%"> + <p class=subcabeceras><a class="help_menu" href="manual.php"> <?php echo $TbMsg["MANUAL"] ?> </a> </p> + <p class=subcabeceras><a class="help_menu" href="../api/index.html"> <?php echo $TbMsg["API"] ?> </a></p> + <p class=subcabeceras><a class="help_menu" href="engine.php"> <?php echo $TbMsg["CFG"] ?> </a> </p> + <p> </p> + <p class=subcabeceras><a class="help_menu" href="changelog.php"> <?php echo $TbMsg["CHANGELOG"]." ".$version ?> </a> </p> + <p class=subcabeceras><a class="help_menu" href="https://listas.unizar.es/cgi-bin/mailman/listinfo/opengnsys-users" target="_blank"> <?php echo $TbMsg["USERMAIL"] ?> </a> </p> + <p class=subcabeceras><a class="help_menu" href="https://opengnsys.es/" target="_blank"> <?php echo $TbMsg["WEB"] ?> </a> </p> + <p class=subcabeceras><a class="help_menu" href="acercade.php"> <?php echo $TbMsg["ABOUT"] ?> </a> </p> +</div> +</body> +</html> diff --git a/admin/WebConsole/principal/changelog.php b/admin/WebConsole/principal/changelog.php new file mode 100644 index 00000000..bf829826 --- /dev/null +++ b/admin/WebConsole/principal/changelog.php @@ -0,0 +1,36 @@ +<?php +//********************************************************************** +// Descripción : Muestra la configuración de los clientes en engine.cfg +//********************************************************************** +include_once("../includes/ctrlacc.php"); +include_once("../idiomas/php/".$idioma."/ayuda_".$idioma.".php"); + +// Añadir versión. +$data = json_decode(@file_get_contents('../../doc/VERSION.json')); +$version=(empty($data->project)) ? "OpenGnsys" : @$data->project.' '.@$data->version.' '.(isset($data->codename) ? '('.$data->codename.') ' : '').@$data->release;; + +$changelogfile="../../doc/CHANGELOG.es.txt"; +$changelog=(file_exists ($changelogfile)) ? file_get_contents($changelogfile, TRUE) : ""; +?> +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html> + <head> + <title> Administración web de aulas </title> + <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> + <link rel="stylesheet" type="text/css" href="../estilos.css" /> + </head> + + <body> + + <div><p align=center class=cabeceras><img border=0 nod="aulas-1" value="Sala Virtual" style="cursor:pointer" src="../images/iconos/aula.gif" > <?php echo $TbMsg["CHANGELOG_TITLE"] ?><br> + <span id="aulas-1" class=subcabeceras><?php echo $version ?></span></p> + </div> + + <div style="margin: 0 3em 0 3em"> + <pre> + <?php echo $changelog; ?> + <pre> + </div> + </body> +</html> + diff --git a/admin/WebConsole/principal/engine.php b/admin/WebConsole/principal/engine.php new file mode 100644 index 00000000..55004b8d --- /dev/null +++ b/admin/WebConsole/principal/engine.php @@ -0,0 +1,32 @@ +<?php +//********************************************************************** +// Descripción : Muestra la configuración de los clientes en engine.cfg +//********************************************************************** +include_once("../includes/ctrlacc.php"); +include_once("../idiomas/php/".$idioma."/ayuda_".$idioma.".php"); + +$cfgfile="../../client/etc/engine.cfg"; +$config=(file_exists ($cfgfile)) ? file_get_contents($cfgfile, TRUE) : "No hay acceso al fichero de configuración"; +?> +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html> + <head> + <title> Administración web de aulas </title> + <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> + <link rel="stylesheet" type="text/css" href="../estilos.css" /> + </head> + + <body> + + <div><p align=center class=cabeceras><img border=0 nod="aulas-1" value="Sala Virtual" style="cursor:pointer" src="../images/iconos/aula.gif" > <?php echo $TbMsg["ENGINE_TITLE"] ?><br> + <span id="aulas-1" class=subcabeceras><?php echo $TbMsg["ENGINE_SUBTITLE"] ?></span></p> + </div> + + <div style="margin: 0 3em 0 3em"> + <pre> + <?php echo $config; ?> + <pre> + </div> + </body> +</html> + diff --git a/admin/WebConsole/principal/imagenes.php b/admin/WebConsole/principal/imagenes.php index ac358491..553979db 100644 --- a/admin/WebConsole/principal/imagenes.php +++ b/admin/WebConsole/principal/imagenes.php @@ -230,16 +230,24 @@ function SubarbolXML_gruposimagenes($grupoid,$ambg,$litambg,$amb,$litamb,$tipo) function SubarbolXML_Imagenes($grupoid,$amb,$litamb,$tipo) { + global $TbMsg; global $cmd; global $idcentro; $cadenaXML=""; $rs=new Recordset; #### agp ### Añado la consulta el campo idrepositorio #### - $cmd->texto="SELECT DISTINCT imagenes.idimagen,imagenes.descripcion,repositorios.nombrerepositorio,repositorios.ip - FROM imagenes INNER JOIN repositorios USING (idrepositorio) - WHERE imagenes.idrepositorio = repositorios.idrepositorio - AND imagenes.idcentro=".$idcentro." + $cmd->texto="SELECT DISTINCT imagenes.idimagen,imagenes.descripcion, IFNULL(repositorios.nombrerepositorio,'".$TbMsg["DELETEDREPO"]."') AS nombrerepositorio + FROM imagenes "; + // Para hallar el repositorio de las incrementales hay que buscar los datos de la imagen basica (en la propia tablas imágenes) + if ($tipo == 3) { + $cmd->texto.=" INNER JOIN imagenes AS basica + LEFT JOIN repositorios ON basica.idrepositorio=repositorios.idrepositorio + WHERE imagenes.imagenid=basica.idimagen AND "; + } else { + $cmd->texto.=" LEFT JOIN repositorios USING (idrepositorio) WHERE "; + } + $cmd->texto.=" imagenes.idcentro=".$idcentro." AND imagenes.grupoid=".$grupoid." AND imagenes.tipo=".$tipo." ORDER BY imagenes.descripcion"; diff --git a/admin/WebConsole/principal/manual.php b/admin/WebConsole/principal/manual.php new file mode 100644 index 00000000..ce9885cc --- /dev/null +++ b/admin/WebConsole/principal/manual.php @@ -0,0 +1,63 @@ +<?php +// **************************************************************************************** +// Aplicacion WEB: ogAdmWebCon +// autor: Irina Gomez, ETSII Universidad de Sevilla +// Fecha: 2018-10-11 +// Descripción : Página de indice del manual de usuario +// **************************************************************************************** +include_once("../includes/ctrlacc.php"); +include_once("../idiomas/php/".$idioma."/ayuda_".$idioma.".php"); + +// Obtenemos nombres de los temas del manual +//ruta manual usuario +$nombredir = '../userManual'; +$directorio=opendir($nombredir); +//obtenemos un archivo y luego otro sucesivamente +while ($archivo = readdir($directorio)) +{ + if (is_dir($archivo)) continue; + if ($archivo == '.' || $archivo == '..') continue; + $fichero[] = $archivo; +} + +sort($fichero); + +$temas = ''; +foreach ($fichero as $ficheros) { + $temas .=' <p><a href="'.$nombredir.'/'.$ficheros.'" target=miframeflotante >'.$ficheros.'</a></P>'."\n"; +} +?> + +<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN' 'http://www.w3.org/TR/html4/loose.dtd'> +<html> +<head> +<title> Administración web de aulas </title> +<meta http-equiv='Content-Type' content='text/html;charset=UTF-8'> +<link rel='stylesheet' type='text/css' href='../estilos.css' /> +</head> + +<body class='acercade'> +<div><p align=center class=cabeceras><img border=0 nod="aulas-1" value="Sala Virtual" style="cursor:pointer" src="../images/iconos/aula.gif" > <?php echo $TbMsg["MANUAL"] ?><br> + +<table width='100%' border='0'> + <tr> + <td width='30%'><p><img src='../images/acercade.png' alt='*' hspace='10em' vspace='10em' align='left' /></p> + <p> </p> + <p> </p> + <p> </p> + <p> </p> + <p><img alt='OpenGnsys' src='../images/iconos/logoopengnsys.png' /></p></td> + <td width='61%'> + <?php echo $temas ?> + </td> + </tr> + +</table> + +<table width='100%' height='100%' border='0'> + <tr > + <td align='center' > + <?php echo '<iframe id=miframeflotante name=miframeflotante src="'.$nombredir.'/'.$fichero[0].'" width=100% height=700 frameborder=0 scrolling=no marginwidth=0 marginheight=0 align=left>Tu navegador no soporta frames!!</iframe>'; ?> + </td> + </tr> +</table> diff --git a/admin/WebConsole/propiedades/propiedades_ordenadores.php b/admin/WebConsole/propiedades/propiedades_ordenadores.php index 0b5442bf..887e87e0 100644 --- a/admin/WebConsole/propiedades/propiedades_ordenadores.php +++ b/admin/WebConsole/propiedades/propiedades_ordenadores.php @@ -156,7 +156,7 @@ function abrir_ventana(URL){ echo '<option value="'.$fotomenu.'">'.$fotomenu.'</option>';} if ($handle = opendir("../images/fotos")) { while (false !== ($entry = readdir($handle))) { - if ($entry != "." && $entry != "..") {?> + if ($entry != "." && $entry != "..") {?> <option value="<?php echo $entry ?>"><?php echo $entry ?></option> <?php } } @@ -165,7 +165,7 @@ function abrir_ventana(URL){ ?> </SELECT> <a href="javascript:abrir_ventana('../images/ver.php')" onclick="MM_openBrWindow('../images/ver.php','Imagenes','scrollbars=yes,resizable=yes,width=950,height=640')"><?php echo $TbMsg[5092] ?></a> - </TD> + </TD> <?php } ?> @@ -181,15 +181,17 @@ function abrir_ventana(URL){ ?> </TR> <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> - <TR> - <th align=center> <?php echo $TbMsg[10]?> </th> + <tr> + <th align="center"> <?php echo $TbMsg[10]?> </th> <?php - if ($opcion==$op_eliminacion) - echo '<TD colspan=3>'.TomaDato($cmd,$idcentro,'repositorios',$idrepositorio,'idrepositorio','nombrerepositorio').'</TD>'; - else - echo '<TD colspan=3>'.HTMLSELECT($cmd,$idcentro,'repositorios',$idrepositorio,'idrepositorio','nombrerepositorio',250).'</TD>'; + if ($opcion==$op_eliminacion) { + echo '<td colspan="3">'.TomaDato($cmd,$idcentro,'repositorios',$idrepositorio,'idrepositorio','nombrerepositorio').'</td>'; + } else { + echo '<td colspan="3">'.HTMLSELECT($cmd,$idcentro,'repositorios',$idrepositorio,'idrepositorio','nombrerepositorio',250); + echo ($idrepositorio==0?$TbMsg["WARN_NOREPO"]:'').'</td>'; + } ?> - </TR> + </tr> <!---- AGP -------------------------------------------------------------------- OGLIVE ---------------------------------------------------------------------------------------------------------> <TR> <th align=center> <?php echo $TbMsg[18]?> </th> @@ -403,4 +405,3 @@ EOD; } return(false); } -?> diff --git a/admin/WebConsole/propiedades/propiedades_repositorios.php b/admin/WebConsole/propiedades/propiedades_repositorios.php index 13db2dc5..b2407b8a 100644 --- a/admin/WebConsole/propiedades/propiedades_repositorios.php +++ b/admin/WebConsole/propiedades/propiedades_repositorios.php @@ -1,258 +1,239 @@ -<?php
-// *********************************************************************************************************
-// Aplicación WEB: ogAdmWebCon
-// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
-// Fecha Creaciónn: Año 2009-2010
-// Fecha Última modificación: Agosto-2010
-// Nombre del fichero: propiedades_repositorios.php
-// Descripción :
-// Presenta el formulario de captura de datos de un repositorio para insertar,modificar y eliminar
-// **********************************************************************************************************
-include_once("../includes/ctrlacc.php");
-include_once("../includes/opciones.php");
-include_once("../includes/comunes.php");
-include_once("../includes/CreaComando.php");
-include_once("../clases/AdoPhp.php");
-include_once("../idiomas/php/".$idioma."/propiedades_repositorios_".$idioma.".php");
-// Fichero con funciones para trabajar con el webservice
-include_once("../includes/restfunctions.php");
-//________________________________________________________________________________________________________
-$opcion=0;
-$opciones=array($TbMsg[0],$TbMsg[1],$TbMsg[2],$TbMsg[3]);
-//________________________________________________________________________________________________________
-$idrepositorio=0;
-$nombrerepositorio="";
-$ip="";
-$puertorepo="2002";
-$apiKeyRepo="";
-$grupoid=0;
-$comentarios="";
-$ordenadores=0; // Número de ordenador a los que da servicio
-$numordenadores=0; // Número de ordenador a los que da servicio
-
-if (isset($_GET["opcion"])) $opcion=$_GET["opcion"]; // Recoge parametros
-if (isset($_GET["idrepositorio"])) $idrepositorio=$_GET["idrepositorio"];
-if (isset($_GET["grupoid"])) $grupoid=$_GET["grupoid"];
-if (isset($_GET["identificador"])) $idrepositorio=$_GET["identificador"];
-//________________________________________________________________________________________________________
-$cmd=CreaComando($cadenaconexion); // Crea objeto comando
-if (!$cmd)
- Header('Location: '.$pagerror.'?herror=2'); // Error de conexión con repositorio B.D.
-if ($opcion!=$op_alta){
- $resul=TomaPropiedades($cmd,$idrepositorio);
- if (!$resul)
- Header('Location: '.$pagerror.'?herror=3'); // Error de recuperaci�n de datos.
-}
-//________________________________________________________________________________________________________
-//#########################################################################
-
-// Si tenemos un apiKey podemos obtener la información desde el webservice en el repositorio
-if($apiKeyRepo != ""){
- $repo[0]['url'] = "https://$ip/opengnsys/rest/repository/images";
- $repo[0]['header'] = array('Authorization: '.$apiKeyRepo);
- $result = multiRequest($repo);
- if ($result[0]['code'] === 200) {
- $result = json_decode($result[0]['data']);
- $repodir = $result->directory;
- $totalrepo = humanSize($result->disk->total);
- $librerepo = humanSize($result->disk->free);
- $ocupadorepo = humanSize($result->disk->total - $result->disk->free);
- $porcentajerepo = 100 - floor(100 * $result->disk->free / $result->disk->total);
- $repoOus = $result->ous;
- $repoImages = $result->images;
- $repoWithApi = true;
- } else {
- // Error de acceso a la API REST.
- $repoWithApi = false;
- $repoImages = null;
- }
-} else {
- // Error de acceso a la API REST.
- $repoWithApi = false;
- $repoImages = null;
-}
-
-//#########################################################################
-?>
-<HTML>
-<TITLE>Administración web de aulas</TITLE>
-<HEAD>
- <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
- <LINK rel="stylesheet" type="text/css" href="../estilos.css">
- <SCRIPT language="javascript" src="../jscripts/validators.js"></SCRIPT>
- <SCRIPT language="javascript" src="../jscripts/propiedades_repositorios.js"></SCRIPT>
- <SCRIPT language="javascript" src="../jscripts/opciones.js"></SCRIPT>
- <?php echo '<SCRIPT language="javascript" src="../idiomas/javascripts/'.$idioma.'/propiedades_repositorios_'.$idioma.'.js"></SCRIPT>'?>
-</HEAD>
-<BODY>
-<DIV align=center>
-<FORM name="fdatos" action="../gestores/gestor_repositorios.php" method="post">
- <INPUT type=hidden name=opcion value="<?php echo $opcion?>">
- <INPUT type=hidden name=idrepositorio value="<?php echo $idrepositorio?>">
- <INPUT type=hidden name=grupoid value="<?php echo $grupoid?>">
- <INPUT type=hidden name=ordenadores value="<?php echo $ordenadores?>">
-
- <P align=center class=cabeceras><?php echo $TbMsg[4]?><BR>
- <SPAN align=center class=subcabeceras><?php echo $opciones[$opcion]?></SPAN></P>
- <TABLE align=center border=0 cellPadding=1 cellSpacing=1 class=tabla_datos >
-<!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -->
- <TR>
- <TH align="center"> <?php echo $TbMsg[5]?> </TD>
- <?php
- if ($opcion==$op_eliminacion)
- echo '<TD>'.$nombrerepositorio.'</TD>';
- else
- echo '<TD><INPUT class="formulariodatos" name="nombrerepositorio" style="width:200" type="text" value="'.$nombrerepositorio.'"></TD>';
- ?>
- <TD valign="top" align="left" rowspan="4" ><CENTER>
- <IMG border="3" style="border-color:#63676b" src="../images/aula.jpg">
- <BR> Ordenadores: <?php echo $ordenadores?></CENTER></TD>
- </TR>
-<!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -->
- <TR>
- <TH align=center> <?php echo $TbMsg[6]?> </TD>
- <?php
- if ($opcion==$op_eliminacion)
- echo '<TD>'.$ip.'</TD>';
- else
- echo'<TD><INPUT class="formulariodatos" name="ip" type="text" style="width:200" value="'.$ip.'"></TD>';
- ?>
- </TR>
-<!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -->
- <TR>
- <TH align=center> <?php echo $TbMsg[8]?> </TD>
- <?php
- if ($opcion==$op_eliminacion)
- echo '<TD>'.$puertorepo.'</TD>';
- else
- echo'<TD><INPUT class="formulariodatos" name=puertorepo type="text" style="width:200" value="'.$puertorepo.'"></TD>';
- ?>
- </TR>
-<!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -->
- <TR>
- <TH align=center> <?php echo $TbMsg[17]?> </TD>
- <?php
- if ($opcion==$op_eliminacion)
- echo '<TD>'.$apiKeyRepo.'</TD>';
- else
- echo'<TD><INPUT class="formulariodatos" name="apiKeyRepo" type="text" style="width:200" value="'.$apiKeyRepo.'"></TD>';
- ?>
- </TR>
-<!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -->
- <TR>
- <TH align=center> <?php echo $TbMsg[7]?> </TD>
- <?php
- if ($opcion==$op_eliminacion)
- echo '<TD colspan="2">'.$comentarios.'</TD>';
- else
- echo '<TD colspan="2"><TEXTAREA class="formulariodatos" name="comentarios" rows=2 cols=50>'.$comentarios.'</TEXTAREA></TD>';
- ?>
- </TR>
-
-<!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -->
-
- </TABLE>
- <?php if ( $opcion == 1 ){} else { ?>
-
- <TABLE align=center border=0 cellPadding=2 cellSpacing=2 class=tabla_datos >
- <!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -->
-
- <?php if ($repoWithApi) { ?>
- <TR>
- <TH align=center width=125> <?php echo $TbMsg[11]?> </TD>
- <TH align=center width=120> <?php echo $TbMsg[12]?> </TD>
- <TH align=center width=120> <?php echo $TbMsg[13]?> </TD>
- <TH align=center width=101> <?php echo $TbMsg[14]?> </TD>
- </TR>
- <TR>
- <TD align=center width=125> <?php echo $totalrepo?> </TD>
- <TD align=center width=120> <?php echo $ocupadorepo?> </TD>
- <TD align=center width=120> <?php echo $librerepo?> </TD>
- <TD align=center width=101> <?php echo "$porcentajerepo %" ?> </TD>
- </TR>
- <?php
- // Si tenemos informacion del repositorio remoto, mostramos las imagenes
- if($repoWithApi == true && is_array($repoImages)){
- echo "<tr class='tabla_listados_sin'><th colspan='4'>".$TbMsg['MSG_CONTENT']." $repodir</th></tr>\n";
-
-echo "<tr><td>".$TbMsg['MSG_IMAGE']." (".$TbMsg['MSG_TYPE'].")</td><td>".$TbMsg['MSG_SIZE']."</td><td>".$TbMsg['MSG_MODIFIED']."</td><td>".$TbMsg['MSG_PERMISSIONS']."</td></tr>\n";
- foreach($repoImages as $image){
- echo "<tr class='tabla_listados_sin'>";
- echo "<td>".$image->name." (".$image->type.")</td>";
- echo "<td>".humanSize($image->size)."</td>";
- echo "<td>".$image->modified."</td>";
- echo "<td>".$image->mode."</td>";
- echo "</tr>\n";
- }
- foreach($repoOus as $ou) {
- foreach($ou->images as $image) {
- echo "<tr class='tabla_listados_sin'>";
- echo "<td>".$ou->subdir." / ".$image->name." (".$image->type.")</td>";
- echo "<td>".$image->size." bytes</td>";
- echo "<td>".$image->modified."</td>";
- echo "<td>".$image->mode."</td>";
- echo "</tr>\n";
- }
- }
- }
- ?>
- <?php }else { ?>
- <tr>
- <th align="center"> <?php echo '<strong>'.$TbMsg[15].'</strong></br>'.$TbMsg[16] ?></th>
- </tr>
- <?php } ?>
- <?php } ?>
-<!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -->
-
- </TABLE>
-
-
-</FORM>
-</DIV>
-<?php
-//________________________________________________________________________________________________________
-include_once("../includes/opcionesbotonesop.php");
-//________________________________________________________________________________________________________
-?>
-</BODY>
-</HTML>
-<?php
-//________________________________________________________________________________________________________
-// Recupera los datos de un repositorio
-// Parametros:
-// - cmd: Una comando ya operativo (con conexión abierta)
-// - id: El identificador del repositorio
-//________________________________________________________________________________________________________
-function TomaPropiedades($cmd,$id){
- global $nombrerepositorio;
- global $ip;
- global $comentarios;
- global $puertorepo;
- global $apiKeyRepo;
- global $ordenadores;
-
-
- // NOTA: el parámetro "numordenadores" no se está utilizando, por lo que se
- // simplifica la consulta, ignorando dicho valor.
-/*
- $cmd->texto="SELECT repositorios.*, count(*) as numordenadores FROM repositorios
- INNER JOIN ordenadores ON ordenadores.idrepositorio=repositorios.idrepositorio
- WHERE repositorios.idrepositorio=".$id;
-*/
- $cmd->texto="SELECT * FROM repositorios WHERE idrepositorio=$id";
- $rs=new Recordset;
- $rs->Comando=&$cmd;
- if (!$rs->Abrir()) return(true); // Error al abrir recordset
- $rs->Primero();
- if (!$rs->EOF){
- $nombrerepositorio=$rs->campos["nombrerepositorio"];
- $ip=$rs->campos["ip"];
- $comentarios=$rs->campos["comentarios"];
- $puertorepo=$rs->campos["puertorepo"];
- $apiKeyRepo=$rs->campos["apikey"];
-// $ordenadores=$rs->campos["numordenadores"];
- }
- $rs->Cerrar();
- return(true);
-}
-?>
+<?php +// ********************************************************************************************************* +// Aplicación WEB: ogAdmWebCon +// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla +// Fecha Creaciónn: Año 2009-2010 +// Fecha Última modificación: Agosto-2010 +// Nombre del fichero: propiedades_repositorios.php +// Descripción : +// Presenta el formulario de captura de datos de un repositorio para insertar,modificar y eliminar +// ********************************************************************************************************** +include_once("../includes/ctrlacc.php"); +include_once("../includes/opciones.php"); +include_once("../includes/comunes.php"); +include_once("../includes/CreaComando.php"); +include_once("../clases/AdoPhp.php"); +include_once("../idiomas/php/".$idioma."/propiedades_repositorios_".$idioma.".php"); +// Fichero con funciones para trabajar con el webservice +include_once("../includes/restfunctions.php"); +//________________________________________________________________________________________________________ +$opcion=0; +$opciones=array($TbMsg[0],$TbMsg[1],$TbMsg[2],$TbMsg[3]); +//________________________________________________________________________________________________________ +$idrepositorio=0; +$nombrerepositorio=""; +$ip=""; +$apiKeyRepo=""; +$grupoid=0; +$comentarios=""; +$ordenadores=0; // Número de ordenador a los que da servicio +$numordenadores=0; // Número de ordenador a los que da servicio + +if (isset($_GET["opcion"])) $opcion=$_GET["opcion"]; // Recoge parametros +if (isset($_GET["idrepositorio"])) $idrepositorio=$_GET["idrepositorio"]; +if (isset($_GET["grupoid"])) $grupoid=$_GET["grupoid"]; +if (isset($_GET["identificador"])) $idrepositorio=$_GET["identificador"]; +//________________________________________________________________________________________________________ +$cmd=CreaComando($cadenaconexion); // Crea objeto comando +if (!$cmd) + Header('Location: '.$pagerror.'?herror=2'); // Error de conexión con repositorio B.D. +if ($opcion!=$op_alta){ + $resul=TomaPropiedades($cmd,$idrepositorio); + if (!$resul) + Header('Location: '.$pagerror.'?herror=3'); // Error de recuperaci�n de datos. +} +//________________________________________________________________________________________________________ +//######################################################################### + +// Si tenemos un apiKey podemos obtener la información desde el webservice en el repositorio +if($apiKeyRepo != ""){ + $repo[0]['url'] = "https://$ip/opengnsys/rest/repository/images"; + $repo[0]['header'] = array('Authorization: '.$apiKeyRepo); + $result = multiRequest($repo); + if ($result[0]['code'] === 200) { + $result = json_decode($result[0]['data']); + $repodir = $result->directory; + $totalrepo = humanSize($result->disk->total); + $librerepo = humanSize($result->disk->free); + $ocupadorepo = humanSize($result->disk->total - $result->disk->free); + $porcentajerepo = 100 - floor(100 * $result->disk->free / $result->disk->total); + $repoOus = $result->ous; + $repoImages = $result->images; + $repoWithApi = true; + } else { + // Error de acceso a la API REST. + $repoWithApi = false; + $repoImages = null; + } +} else { + // Error de acceso a la API REST. + $repoWithApi = false; + $repoImages = null; +} + +//######################################################################### +?> +<HTML> +<TITLE>Administración web de aulas</TITLE> +<HEAD> + <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> + <LINK rel="stylesheet" type="text/css" href="../estilos.css"> + <SCRIPT language="javascript" src="../jscripts/validators.js"></SCRIPT> + <SCRIPT language="javascript" src="../jscripts/propiedades_repositorios.js"></SCRIPT> + <SCRIPT language="javascript" src="../jscripts/opciones.js"></SCRIPT> + <?php echo '<SCRIPT language="javascript" src="../idiomas/javascripts/'.$idioma.'/propiedades_repositorios_'.$idioma.'.js"></SCRIPT>'?> +</HEAD> +<BODY> +<DIV align=center> +<FORM name="fdatos" action="../gestores/gestor_repositorios.php" method="post"> + <INPUT type=hidden name=opcion value="<?php echo $opcion?>"> + <INPUT type=hidden name=idrepositorio value="<?php echo $idrepositorio?>"> + <INPUT type=hidden name=grupoid value="<?php echo $grupoid?>"> + <INPUT type=hidden name=ordenadores value="<?php echo $ordenadores?>"> + + <P align=center class=cabeceras><?php echo $TbMsg[4]?><BR> + <SPAN align=center class=subcabeceras><?php echo $opciones[$opcion]?></SPAN></P> + <TABLE align=center border=0 cellPadding=1 cellSpacing=1 class=tabla_datos > +<!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --> + <TR> + <TH align="center"> <?php echo $TbMsg[5]?> </TD> + <?php + if ($opcion==$op_eliminacion) + echo '<TD>'.$nombrerepositorio.'</TD>'; + else + echo '<TD><INPUT class="formulariodatos" name="nombrerepositorio" style="width:200" type="text" value="'.$nombrerepositorio.'"></TD>'; + ?> + <TD valign="top" align="left" rowspan="4" ><CENTER> + <IMG border="3" style="border-color:#63676b" src="../images/aula.jpg"> + <BR> Ordenadores: <?php echo $ordenadores?></CENTER></TD> + </TR> +<!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --> + <TR> + <TH align=center> <?php echo $TbMsg[6]?> </TD> + <?php + if ($opcion==$op_eliminacion) + echo '<TD>'.$ip.'</TD>'; + else + echo'<TD><INPUT class="formulariodatos" name="ip" type="text" style="width:200" value="'.$ip.'"></TD>'; + ?> + </TR> +<!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --> + <TR> + <TH align=center> <?php echo $TbMsg[17]?> </TD> + <?php + if ($opcion==$op_eliminacion) + echo '<TD>********</TD>'; + else + echo'<TD><INPUT class="formulariodatos" name="apiKeyRepo" type="text" style="width:200" value="'.$apiKeyRepo.'"></TD>'; + ?> + </TR> +<!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --> + <TR> + <TH align=center> <?php echo $TbMsg[7]?> </TD> + <?php + if ($opcion==$op_eliminacion) + echo '<TD colspan="2">'.$comentarios.'</TD>'; + else + echo '<TD colspan="2"><TEXTAREA class="formulariodatos" name="comentarios" rows=2 cols=50>'.$comentarios.'</TEXTAREA></TD>'; + ?> + </TR> + +<!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --> + + </TABLE> + <?php if ( $opcion == 1 ){} else { ?> + + <TABLE align=center border=0 cellPadding=2 cellSpacing=2 class=tabla_datos > + <!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --> + + <?php if ($repoWithApi) { ?> + <TR> + <TH align=center width=125> <?php echo $TbMsg[11]?> </TD> + <TH align=center width=120> <?php echo $TbMsg[12]?> </TD> + <TH align=center width=120> <?php echo $TbMsg[13]?> </TD> + <TH align=center width=101> <?php echo $TbMsg[14]?> </TD> + </TR> + <TR> + <TD align=center width=125> <?php echo $totalrepo?> </TD> + <TD align=center width=120> <?php echo $ocupadorepo?> </TD> + <TD align=center width=120> <?php echo $librerepo?> </TD> + <TD align=center width=101> <?php echo "$porcentajerepo %" ?> </TD> + </TR> + <?php + // Si tenemos informacion del repositorio remoto, mostramos las imagenes + if($repoWithApi == true && is_array($repoImages)){ + echo "<tr class='tabla_listados_sin'><th colspan='4'>".$TbMsg['MSG_CONTENT']." $repodir</th></tr>\n"; + +echo "<tr><td>".$TbMsg['MSG_IMAGE']." (".$TbMsg['MSG_TYPE'].")</td><td>".$TbMsg['MSG_SIZE']."</td><td>".$TbMsg['MSG_MODIFIED']."</td><td>".$TbMsg['MSG_PERMISSIONS']."</td></tr>\n"; + foreach($repoImages as $image){ + echo "<tr class='tabla_listados_sin'>"; + echo "<td>".$image->name." (".$image->type.")</td>"; + echo "<td>".humanSize($image->size)."</td>"; + echo "<td>".$image->modified."</td>"; + echo "<td>".$image->mode."</td>"; + echo "</tr>\n"; + } + foreach($repoOus as $ou) { + foreach($ou->images as $image) { + echo "<tr class='tabla_listados_sin'>"; + echo "<td>".$ou->subdir." / ".$image->name." (".$image->type.")</td>"; + echo "<td>".$image->size." bytes</td>"; + echo "<td>".$image->modified."</td>"; + echo "<td>".$image->mode."</td>"; + echo "</tr>\n"; + } + } + } + ?> + <?php }else { ?> + <tr> + <th align="center"> <?php echo '<strong>'.$TbMsg[15].'</strong></br>'.$TbMsg[16] ?></th> + </tr> + <?php } ?> + <?php } ?> +<!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --> + + </TABLE> +</FORM> +</DIV> +<?php +//________________________________________________________________________________________________________ +include_once("../includes/opcionesbotonesop.php"); +//________________________________________________________________________________________________________ +?> +</BODY> +</HTML> +<?php +//________________________________________________________________________________________________________ +// Recupera los datos de un repositorio +// Parametros: +// - cmd: Una comando ya operativo (con conexión abierta) +// - id: El identificador del repositorio +//________________________________________________________________________________________________________ +function TomaPropiedades($cmd,$id){ + global $nombrerepositorio; + global $ip; + global $comentarios; + global $apiKeyRepo; + global $ordenadores; + + $cmd->texto=<<<EOT +SELECT repositorios.*, COUNT(ordenadores.idordenador) AS numordenadores + FROM repositorios + LEFT JOIN ordenadores USING(idrepositorio) + WHERE repositorios.idrepositorio='$id'; +EOT; + $rs=new Recordset; + $rs->Comando=&$cmd; + if (!$rs->Abrir()) return(true); // Error al abrir recordset + $rs->Primero(); + if (!$rs->EOF){ + $nombrerepositorio=$rs->campos["nombrerepositorio"]; + $ip=$rs->campos["ip"]; + $comentarios=$rs->campos["comentarios"]; + $apiKeyRepo=$rs->campos["apikey"]; + $ordenadores=$rs->campos["numordenadores"]; + } + $rs->Cerrar(); + return(true); +} diff --git a/admin/WebConsole/rest/server.php b/admin/WebConsole/rest/server.php index 1721411d..93cef872 100644 --- a/admin/WebConsole/rest/server.php +++ b/admin/WebConsole/rest/server.php @@ -878,7 +878,6 @@ EOD; $response['name'] = $rs->campos["nombrerepositorio"]; $response['description'] = $rs->campos["comentarios"]; $response['ip'] = $rs->campos["ip"]; - //$response['port'] = $rs->campos["puertorepo"]; jsonResponse(200, $response); } $rs->Cerrar(); diff --git a/admin/WebConsole/varios/buscar.php b/admin/WebConsole/varios/buscar.php index 62f27fb6..552e32b7 100644 --- a/admin/WebConsole/varios/buscar.php +++ b/admin/WebConsole/varios/buscar.php @@ -23,7 +23,7 @@ $valor=""; # Tomar varlores de sesión. if (isset($_POST["criterio"])) $criterio=htmlspecialchars($_POST["criterio"]); if (isset($_POST["valor"])) $valor=htmlspecialchars($_POST["valor"]); -if (!empty ($valor) or $criterio == "duplic" or $criterio == "profe") { +if (!empty ($valor) or $criterio == "duplic" or $criterio == "profe" or $criterio == "norepo") { $cmd=CreaComando($cadenaconexion); if ($cmd) { $rs=new Recordset; @@ -107,6 +107,20 @@ if (!empty ($valor) or $criterio == "duplic" or $criterio == "profe") { AND aulas.idcentro='$idcentro' ORDER BY aulas.nombreaula"; break; + case "norepo": // Mostrar ordenadores sin repositorio + $cmd->texto="SELECT grupos.nombregrupo AS grupo, + aulas.nombreaula AS aula, + ordenadores.idordenador AS id, + ordenadores.nombreordenador AS nombre, + ordenadores.ip AS ip, + ordenadores.mac AS mac + FROM ordenadores + JOIN aulas ON aulas.idaula=ordenadores.idaula + LEFT JOIN grupos ON grupos.idgrupo=aulas.grupoid + WHERE aulas.idcentro='$idcentro' + AND idrepositorio=0 + ORDER BY aulas.nombreaula;"; + break; } $rs->Comando=&$cmd; if ($rs->Abrir()) { @@ -140,7 +154,7 @@ function confirmar(){ } //_________________________________ function comprobar_datos(){ - if (document.fdatos.valor.value=="" && document.fdatos.criterio.value!="duplic" && document.fdatos.criterio.value!="profe") { + if (document.fdatos.valor.value=="" && document.fdatos.criterio.value!="duplic" && document.fdatos.criterio.value!="profe" && document.fdatos.criterio.value!="norepo") { alert("<?php echo $TbMsg["SEARCH_NOVALUE"] ?>"); document.fdatos.valor.focus(); return(false) @@ -161,14 +175,13 @@ function PulsaEnter(oEvento){ if (iAscii == 13) confirmar(); return true; } -//_________________________________ </script> </head> <body> <p align="center"><u><span class="cabeceras"><?php echo $TbMsg["SEARCH_TITLE"] ?></span></u></p> <?php -if (!empty ($valor) or $criterio == "duplic" or $criterio == "profe") { +if (!empty ($valor) or $criterio == "duplic" or $criterio == "profe" or $criterio == "norepo") { if (empty ($aula)) { echo '<p class="subcabeceras" align="center">'.$TbMsg["SEARCH_NOMATCHES"].'</p>'; } else { @@ -200,12 +213,13 @@ if (!empty ($valor) or $criterio == "duplic" or $criterio == "profe") { <div align="center" style="margin:20;"> <form action="#" class="formulariodatos" name="fdatos" method="post"> <?php echo $TbMsg["SEARCH_CRITERIA"] ?>: - <select name="criterio" id="criterio" onchange="if (document.fdatos.criterio.value=='duplic' || document.fdatos.criterio.value=='profe') document.fdatos.valor.disabled=true; else document.fdatos.valor.disabled=false"> + <select name="criterio" id="criterio" onchange="if (document.fdatos.criterio.value=='duplic' || document.fdatos.criterio.value=='profe' || document.fdatos.criterio.value=='norepo') document.fdatos.valor.disabled=true; else document.fdatos.valor.disabled=false"> <option value="nombre"> <?php echo $TbMsg["SEARCH_NAME"] ?> </option> <option value="ip"> <?php echo $TbMsg["SEARCH_IP"] ?> </option> <option value="mac"> <?php echo $TbMsg["SEARCH_MAC"] ?> </option> <option value="duplic"> <?php echo $TbMsg["SEARCH_DUPLICATES"] ?> </option> <option value="profe"> <?php echo $TbMsg["SEARCH_PROFESSOR"] ?> </option> + <option value="norepo"> <?php echo $TbMsg["SEARCH_NOREPO"] ?> </option> </select> <input type="text" name="valor" id="valor" size="20" /> <div align="center"> diff --git a/admin/WebConsole/varios/incorporaordenadores.php b/admin/WebConsole/varios/incorporaordenadores.php index 103f7171..2615fbad 100644 --- a/admin/WebConsole/varios/incorporaordenadores.php +++ b/admin/WebConsole/varios/incorporaordenadores.php @@ -7,6 +7,8 @@ // Nombre del fichero: incorporaordenadores.php // Descripción : // Da de alta en la base de datos nuevos ordenadores desde un fichero de configuración dhcp +// Version 1.1.0: Se obtiene id del repositorio de la OU. Si no existe se muestra alerta para que confirme el alta. +// Fecha: 2018-10-24 // ************************************************************************************************************************************************* include_once("../includes/ctrlacc.php"); include_once("../clases/AdoPhp.php"); @@ -34,6 +36,7 @@ if (isset($_POST["nombreaula"])) $nombreaula=$_POST["nombreaula"]; $resul=0; $ordDup=""; +$idrepositorio = idrepoOU($cmd,$idaula); if(!empty($contenido)){ // Se ha introducido contenido en lugar de fichero $resul=procesaLineas($cmd,$idaula,$contenido); @@ -41,16 +44,27 @@ if(!empty($contenido)){ // Se ha introducido contenido en lugar de fichero //___________________________________________________________________________________________________ ?> <HTML> -<TITLE>Administración web de aulas</TITLE> <HEAD> - <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> -<LINK rel="stylesheet" type="text/css" href="../estilos.css"> + <TITLE>Administración web de aulas</TITLE> + <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> + <LINK rel="stylesheet" type="text/css" href="../estilos.css"> + <SCRIPT language="javascript" src="../idiomas/javascripts/<?php echo $idioma ?>/avisos_<?php echo $idioma ?>.js"></SCRIPT> + <SCRIPT> + function confirmar(){ + if (document.fdatos.idrepositorio.value == '' ){ + if(confirm(TbMsg["WARN_NOREPO"]) != true) + return(false); + } + document.fdatos.submit(); + } + </SCRIPT> </HEAD> <BODY> <FORM action="incorporaordenadores.php" method="post" name="fdatos"> - <INPUT type=hidden name=swf value=1> - <INPUT type=hidden name=idaula value=<?php echo $idaula?>> - <INPUT type=hidden name=nombreaula value=<?php echo $nombreaula?>> + <INPUT type="hidden" name="swf" value="1"> + <INPUT type="hidden" name="idaula" value="<?php echo $idaula?>"> + <INPUT type="hidden" name="nombreaula" value="<?php echo $nombreaula?>"> + <INPUT type="hidden" name="idrepositorio" value="<?php echo idrepoOU($cmd,$idaula);?>"> <BR> <P align=center class=cabeceras><?php echo $TbMsg[0]?><BR> <SPAN align=center class=subcabeceras><IMG src="../images/iconos/aula.gif"> <?php echo $TbMsg[1].":".$nombreaula ?></SPAN></P> @@ -70,7 +84,7 @@ if(!empty($contenido)){ // Se ha introducido contenido en lugar de fichero <TR> <TD><IMG src="../images/boton_cancelar.gif" style="cursor:hand" onclick=""></TD> <TD width=20></TD> - <TD><IMG src="../images/boton_confirmar.gif" style="cursor:hand" onclick="document.fdatos.submit();"></TD> + <TD><IMG src="../images/boton_confirmar.gif" style="cursor:hand" onclick="confirmar();"></TD> </TR> </TABLE> <?php @@ -94,6 +108,8 @@ function procesaLineas($cmd,$idaula,$buffer) $MAC=""; $IP=""; $sw=false; + // Eliminamos comentarios a final de línea + $buffer = preg_replace(array("/\#.*\r\n/", "/\#.*\r/", "/\#.*\n/"), "", $buffer."\n"); $equipos = preg_split('/}/',$buffer); @@ -155,7 +171,7 @@ function Inserta($cmd,$idaula,$nombre,$lamac,$laip) $idperfilhard=0; ## ADV: modificacion para asignar a los ordenadores, cuando se crean desde "incorpoar ordenadores" el repositorio "default" - $idrepositorio=1; + $idrepositorio=idrepoOU($cmd,$idaula); $idconfiguracion=0; $cmd->CreaParametro("@grupoid",$grupoid,1); $cmd->CreaParametro("@idaula",$idaula,1); @@ -172,6 +188,7 @@ function Inserta($cmd,$idaula,$nombre,$lamac,$laip) @idrepositorio, router, netmask, @idaula, @grupoid FROM aulas WHERE idaula=".$idaula; + $resul=$cmd->Ejecutar(); // Crear fichero de arranque PXE con plantilla por defecto. @@ -184,7 +201,7 @@ function Inserta($cmd,$idaula,$nombre,$lamac,$laip) //________________________________________________________________________________________________________ // Recupera los datos de un ordenador // Parametros: -// - cmd: Una comando ya operativo (con conexión abierta) +// - cmd: Un comando ya operativo (con conexión abierta) // - ip: Dirección IP //________________________________________________________________________________________________________ function existeOrdenador($cmd,$nombre,$MAC,$IP){ @@ -200,4 +217,26 @@ function existeOrdenador($cmd,$nombre,$MAC,$IP){ else return(false); } +//________________________________________________________________________________ +// Primer repositorio asignado a la unidad organizativa +// Parametros: +// - cmd: Un comando ya operativo (con conexión abierta) +// - idaula: identificador del aula +// Salida: idrepositorio del primer repositorio de la OU o '' +//________________________________________________________________________________ +function idrepoOU($cmd,$idaula) { + $idrepositorio = ''; + $rs=new Recordset; + $cmd->texto="SELECT idrepositorio FROM repositorios ". + " INNER JOIN centros USING (idcentro) ". + " INNER JOIN aulas USING (idcentro) ". + " WHERE idaula=$idaula ORDER BY idrepositorio LIMIT 1;"; + $rs->Comando=&$cmd; + if ($rs->Abrir()) { + $rs->Primero(); + $idrepositorio = $rs->campos["idrepositorio"]; + } + $rs->Cerrar(); + return $idrepositorio; +} ?> diff --git a/client/boot-tools/boottoolsfunctions.lib b/client/boot-tools/boottoolsfunctions.lib index c615a9fb..15478248 100755 --- a/client/boot-tools/boottoolsfunctions.lib +++ b/client/boot-tools/boottoolsfunctions.lib @@ -4,7 +4,7 @@ #@brief Librería o clase Boot-Tools #@class Boot-Tools #@brief Funciones para generar un sistema operativo cliente para opengnsys -#@version 1.1.0 +#@version 1.1.1 #@warning License: GNU GPLv3+ #*/ @@ -13,13 +13,7 @@ # Autor: Antonio J. Doblas Viso. Universidad de Málaga. function btogGetVar() { - -export BTSVNBOOTTOOLS=/tmp/opengnsys_installer/opengnsys/client/boot-tools -export BTSVNSHARE=/tmp/opengnsys_installer/opengnsys/client/shared -export BTSVNENGINE=/tmp/opengnsys_installer/opengnsys/client/engine - -export BTSVNOG2=/tmp/opengnsys_installer/opengnsys2 - +export BTDIR=/tmp/opengnsys_installer/opengnsys/client/boot-tools export BTTARGETDIR=/var/lib/tftpboot/ogclient/ export BTROOTFSIMG=${BTTARGETDIR}ogclient.img export BTROOTFSMNT=${BTTARGETDIR}ogclientmount @@ -125,7 +119,7 @@ case "${1,,}" in bionic) # ogLive 1.1.1-rc1 basado en Ubuntu 18.04 y Kernel 4.15. OSDISTRIB="ubuntu" OSCODENAME="bionic" - OSRELEASE="4.15.0-13-generic" + OSRELEASE="4.15.0-32-generic" OSARCH="amd64" OSHTTP="http://es.archive.ubuntu.com/ubuntu/" ;; @@ -141,12 +135,13 @@ case "${1,,}" in exit 1 ;; esac -SVNURL="https://github.com/opengnsys/OpenGnsys/branches/devel/client" -VERSIONSVN=$(LC_ALL=C svn info $SVNURL | awk '/Date:/ {gsub(/-/,""); print ""$4}' -NAMEISOCLIENT="$VERSIONBOOTTOOLS-$OSCODENAME-$OSRELEASE-$OSARCH-$VERSIONSVN" -NAMEHOSTCLIENT="$VERSIONBOOTTOOLS-$OSCODENAME-$VERSIONSVN" +BRANCH="devel" +GITURL="https://api.github.com/repos/opengnsys/OpenGnsys/commits?sha=$BRANCH&path=/client" +GITRELEASE=$(curl -s "$GITURL" | jq -r '"r" + (.[0].commit.committer.date | gsub("-"; "")[:8]) + "." + (.[0].sha[:7])') +NAMEISOCLIENT="$VERSIONBOOTTOOLS-$OSCODENAME-$OSRELEASE-$OSARCH-$GITRELEASE" +NAMEHOSTCLIENT="$VERSIONBOOTTOOLS-$OSCODENAME-$GITRELEASE" export OSDISTRIB OSCODENAME OSRELEASE OSARCH OSHTTP -export TYPECLIENT VERSIONSVN NAMEISOCLIENT NAMEHOSTCLIENT +export TYPECLIENT GITRELEASE NAMEISOCLIENT NAMEHOSTCLIENT ### El fichero de configuración debe sustituir a estos 3 ficheros (borrar las 3 líneas siguientes). echo "$NAMEISOCLIENT" > /tmp/opengnsys_info_rootfs echo "$NAMEHOSTCLIENT" > /tmp/opengnsys_chroot @@ -158,7 +153,7 @@ OSCODENAME="$OSCODENAME" OSRELEASE="$OSRELEASE" OSARCH="$OSARCH" OSHTTP="$OSHTTP" -VERSIONSVN="$VERSIONSVN" +GITRELEASE="$GITRELEASE" NAMEISOCLIENT="$NAMEISOCLIENT" NAMEHOSTCLIENT="$NAMEHOSTCLIENT" EOT @@ -364,7 +359,7 @@ TIMEMOD=`date +%Y%m%d-%H%M%S` #copiando cp /tmp/initrd.img-${OSRELEASE} ${BTTARGETDIR}/oginitrd.img -cp /tmp/vmlinuz-${OSRELEASE}.efi.signed ${BTTARGETDIR}/ogvmlinuz +cp /tmp/vmlinuz-${OSRELEASE} ${BTTARGETDIR}/ogvmlinuz #generamos md5 del kernel y del initrd. DATASUM=`md5sum "${BTTARGETDIR}/oginitrd.img" | cut -f1 -d" "` echo $DATASUM > ${BTTARGETDIR}/oginitrd.img.sum diff --git a/client/boot-tools/boottoolsgenerator.sh b/client/boot-tools/boottoolsgenerator.sh index 8983f0ee..fb749a7b 100755 --- a/client/boot-tools/boottoolsgenerator.sh +++ b/client/boot-tools/boottoolsgenerator.sh @@ -72,10 +72,10 @@ echo "FASE 4 - Configurar acceso schroot al Segundo Sistema de archivos (img)" cat /etc/schroot/schroot.conf | grep $BTROOTFSIMG || btogSetFsAccess ########################################################################### echo "FASE 5 - Incorporando ficheros OpenGnsys al sistema raíz rootfs " -cp -a ${BTSVNBOOTTOOLS}/includes/usr/bin/* /tmp +cp -a ${BTDIR}/includes/usr/bin/* /tmp chmod +x /tmp/boot-tools/*.sh # Incluir revisión. -sed -i "1 s/$/ $VERSIONSVN/" ${BTSVNBOOTTOOLS}/includes/etc/initramfs-tools/scripts/VERSION.txt +sed -i "1 s/$/ $GITRELEASE/" ${BTDIR}/includes/etc/initramfs-tools/scripts/VERSION.txt # En Ubuntu 13.04+ es necesario matar proceso de "udev" antes de desmontar. umount $BTROOTFSMNT 2>/dev/null || (kill -9 $(lsof -t $BTROOTFSMNT); umount $BTROOTFSMNT 2>/dev/null) schroot -p -c IMGogclient -- /tmp/boot-tools/boottoolsFsOpengnsys.sh diff --git a/client/boot-tools/includes/etc/initramfs-tools/scripts/VERSION.txt b/client/boot-tools/includes/etc/initramfs-tools/scripts/VERSION.txt index 2878503d..45805bd6 100644 --- a/client/boot-tools/includes/etc/initramfs-tools/scripts/VERSION.txt +++ b/client/boot-tools/includes/etc/initramfs-tools/scripts/VERSION.txt @@ -1 +1 @@ -OpenGnsys Client 1.1.1-rc1-efi +OpenGnsys Client 1.1.1-rc2 diff --git a/client/boot-tools/includes/etc/initramfs-tools/scripts/ogfunctions b/client/boot-tools/includes/etc/initramfs-tools/scripts/ogfunctions index f7d712d9..62f0524a 100644 --- a/client/boot-tools/includes/etc/initramfs-tools/scripts/ogfunctions +++ b/client/boot-tools/includes/etc/initramfs-tools/scripts/ogfunctions @@ -550,7 +550,7 @@ then for i in bin sbin lib $LIBS etc var usr root boot; do ogUnionLiveDir $i done - cat /tmp/mtab.preunion > /etc/mtab + [ -L /etc/mtab ] || cat /tmp/mtab.preunion > /etc/mtab else echo "Fichero imagen del cliente no encontrado" return 1 diff --git a/client/boot-tools/includes/usr/bin/boot-tools/boottoolsFsOpengnsys.sh b/client/boot-tools/includes/usr/bin/boot-tools/boottoolsFsOpengnsys.sh index 0e42a7ed..85b00b69 100755 --- a/client/boot-tools/includes/usr/bin/boot-tools/boottoolsFsOpengnsys.sh +++ b/client/boot-tools/includes/usr/bin/boot-tools/boottoolsFsOpengnsys.sh @@ -24,7 +24,7 @@ echo "$OSDISTRIB:$OSCODENAME:$OSRELEASE:$OSARCH:$OSHTTP" LERROR=TRUE -echo "$FUNCNAME: Iniciando la personalización con datos del SVN " +echo "$FUNCNAME: Iniciando la personalización con datos del repositorio" # parseamos el apt.source de la distribución (en minúsculas) sed -e "s/OSCODENAME/$OSCODENAME/g" ${SVNCLIENTDIR}/includes/etc/apt/sources.list.${OSDISTRIB,,} > ${SVNCLIENTDIR}/includes/etc/apt/sources.list @@ -77,8 +77,8 @@ if [ $? -ne 0 ]; then fi # El fichero de configuración debe sustituir a los 2 ficheros (borrar las 2 líneas). -echo "${VERSIONBOOTTOOLS}-${OSCODENAME}-${OSRELEASE}-${VERSIONSVN}" > /$NAMEISOCLIENTFILE -echo "${VERSIONBOOTTOOLS}-${OSCODENAME}-${VERSIONSVN}" > $NAMEHOSTCLIENTFILE +echo "${VERSIONBOOTTOOLS}-${OSCODENAME}-${OSRELEASE}-${GITRELEASE}" > /$NAMEISOCLIENTFILE +echo "${VERSIONBOOTTOOLS}-${OSCODENAME}-${GITRELEASE}" > $NAMEHOSTCLIENTFILE history -c diff --git a/client/boot-tools/includes/usr/bin/boot-tools/boottoolsInitrdGenerate.sh b/client/boot-tools/includes/usr/bin/boot-tools/boottoolsInitrdGenerate.sh index 9ead10a3..714fba5d 100755 --- a/client/boot-tools/includes/usr/bin/boot-tools/boottoolsInitrdGenerate.sh +++ b/client/boot-tools/includes/usr/bin/boot-tools/boottoolsInitrdGenerate.sh @@ -8,7 +8,7 @@ rm -f /usr/lib/initramfs-tools/bin/* cp /bin/busybox /usr/lib/initramfs-tools/bin cd /tmp mkinitramfs -o /tmp/initrd.img-$OSRELEASE -v $OSRELEASE -cp -v /boot/vmlinuz-$OSRELEASE.efi.signed /tmp +cp -v /boot/vmlinuz-$OSRELEASE /tmp history -c diff --git a/client/boot-tools/includes/usr/bin/boot-tools/boottoolsSoftwareInstall.sh b/client/boot-tools/includes/usr/bin/boot-tools/boottoolsSoftwareInstall.sh index 5ad01285..95a64cf9 100755 --- a/client/boot-tools/includes/usr/bin/boot-tools/boottoolsSoftwareInstall.sh +++ b/client/boot-tools/includes/usr/bin/boot-tools/boottoolsSoftwareInstall.sh @@ -51,8 +51,8 @@ if [ "$OSRELEASE" == "3.7.6-030706-generic" ]; then rm -fr /tmp/kernel else # Instalar Kernel firmado del repositorio de paquetes. - apt-get -y --force-yes install linux-signed-image-${OSRELEASE} linux-headers-${OSRELEASE} dkms shim-signed - apt-get -y --force-yes install linux-image-extra-${OSRELEASE} 2>/dev/null + apt-get -y --force-yes install linux-image-${OSRELEASE} linux-headers-${OSRELEASE} dkms shim-signed + apt-get -y --force-yes install linux-modules-${OSRELEASE} linux-modules-extra-${OSRELEASE} 2>/dev/null fi # Valores para paquetes interactivos. diff --git a/client/engine/Boot.lib b/client/engine/Boot.lib index 217980d1..e9ddf38e 100755 --- a/client/engine/Boot.lib +++ b/client/engine/Boot.lib @@ -625,6 +625,8 @@ ps aux > /dev/null | grep $! | grep -E "T|S" | kill -9 $! > /dev/null } + +#/** # ogWindowsRegisterPartition int_ndisk int_partiton str_volume int_disk int_partition #@brief Registra una partición en windows con un determinado volumen. #@param int_ndisk nº de orden del disco a registrar @@ -699,7 +701,7 @@ ps aux > /dev/null | grep $! | grep -E "T|S" | kill -9 $! > /dev/null } - +#/** # ogGrubInstallMbr int_disk_GRUBCFG int_partition_GRUBCFG #@brief Instala el grub el el MBR del primer disco duro (FIRSTSTAGE). El fichero de configuración grub.cfg ubicado según parametros disk y part(SECONDSTAGE). Admite sistemas Windows. #@param int_disk_SecondStage @@ -724,7 +726,8 @@ ps aux > /dev/null | grep $! | grep -E "T|S" | kill -9 $! > /dev/null #@date 2018-01-21 #*/ ## -function ogGrubInstallMbr { +function ogGrubInstallMbr () +{ # Variables locales. local PART DISK VERSION FIRSTAGE SECONSTAGE CHECKOS KERNELPARAM BACKUPNAME @@ -803,7 +806,7 @@ grub-install --force --root-directory=${SECONDSTAGE}${PREFIXSECONDSTAGE} $FIRSTS } - +#/** # ogGrubInstallPartition int_disk_SECONDSTAGE int_partition_SECONDSTAGE bolean_Check_Os_installed_and_Configure_2ndStage #@brief Instala y actualiza el gestor grub en el bootsector de la particion indicada #@param int_disk_SecondStage @@ -823,7 +826,8 @@ grub-install --force --root-directory=${SECONDSTAGE}${PREFIXSECONDSTAGE} $FIRSTS #@date 2012-03-13 #*/ ## -function ogGrubInstallPartition { +function ogGrubInstallPartition () +{ # Variables locales. local PART DISK VERSION FIRSTAGE SECONSTAGE CHECKOS KERNELPARAM BACKUPNAME @@ -909,7 +913,8 @@ grub-install --force --root-directory=${SECONDSTAGE}${PREFIXSECONDSTAGE} $FIRSTS #@author Antonio J. Doblas Viso. Universidad de Malaga. #@date 2016-11-03 #*/ ## -function ogConfigureFstab { +function ogConfigureFstab () +{ # Variables locales. local FSTAB DEFROOT PARTROOT DEFSWAP PARTSWAP @@ -952,9 +957,7 @@ fi } -### -#En pruebas -## + #/** # ogSetLinuxName int_ndisk int_nfilesys [str_name] #@brief Establece el nombre del equipo en los ficheros hostname y hosts. @@ -1078,11 +1081,10 @@ MNTDIR=$(ogMount $1 $2) || return $? #@author Antonio J. Doblas Viso. Universidad de Malaga. #@date 2017-06-17 #*/ ## -#*/ ## -#*/ -function ogGrubAddOgLive () { +function ogGrubAddOgLive () +{ local TIMEOUT DIRMOUNT GRUBGFC PARTTABLETYPE NUMDISK NUMPART KERNEL STATUS NUMLINE MENUENTRY # Si se solicita, mostrar ayuda. @@ -1149,9 +1151,11 @@ MENUENTRY="menuentry "OpenGnsys" --class opengnsys --class gnu --class os { \n #/** # ogGrubHidePartitions num_disk num_part +#@brief ver ogBootLoaderHidePartitions #@see ogBootLoaderHidePartitions -#*/ -function ogGrubHidePartitions { +#*/ ## +function ogGrubHidePartitions () +{ # Si se solicita, mostrar ayuda. if [ "$*" == "help" ]; then ogHelp "$FUNCNAME" "$FUNCNAME int_ndisk int_npartition" \ @@ -1164,9 +1168,11 @@ function ogGrubHidePartitions { #/** # ogBurgHidePartitions num_disk num_part +#@brief ver ogBootLoaderHidePartitions #@see ogBootLoaderHidePartitions -#*/ -function ogBurgHidePartitions { +#*/ ## +function ogBurgHidePartitions () +{ # Si se solicita, mostrar ayuda. if [ "$*" == "help" ]; then ogHelp "$FUNCNAME" "$FUNCNAME int_ndisk int_npartition" \ @@ -1191,8 +1197,13 @@ function ogBurgHidePartitions { #@version 1.1 Se generaliza la función para grub y burg #@author Irina Gomez, ETSII Universidad de Sevilla #@date 2017-10-20 +#@version 1.1.1 Se incluye comentarios en codigo para autodocuemtnacion con Doxygen +#@author Antonio J. Doblas Viso, EVLT Univesidad de Malaga. +#@date 2018-07-05 #*/ -function ogBootLoaderHidePartitions { + +function ogBootLoaderHidePartitions () +{ local FUNC DIRMOUNT GFCFILE PARTTABLETYPE WINENTRY ENTRY PART TEXT LINE2 PART2 HIDDEN # Si se solicita, mostrar ayuda. @@ -1234,9 +1245,10 @@ function ogBootLoaderHidePartitions { sed -i '/parttool/d' $CFGFILE PARTTABLETYPE=$(ogGetPartitionTableType $1 | tr [:upper:] [:lower:]) - +# /* (comentario de bloque para Doxygen) # Entradas de Windows: numero de linea y particion. De mayor a menor. WINENTRY=$(awk '/menuentry.*Windows/ {gsub(/\)\"/, ""); print NR":"$6} ' $CFGFILE | sed -e '1!G;h;$!d' -e s/[a-z\/]//g) + #*/ (comentario para bloque Doxygen) # Particiones de Windows, pueden no estar en el grub. WINPART=$(fdisk -l $(ogDiskToDev $1)|awk '/NTFS/ {print substr($1,9,1)}' |sed '1!G;h;$!d') # Modifico todas las entradas de Windows. @@ -1262,9 +1274,11 @@ function ogBootLoaderHidePartitions { #/** # ogGrubDeleteEntry num_disk num_part num_disk_delete num_part_delete -#@see ogBootLoaderDeleteEntry +#@brief ver ogBootLoaderDeleteEntry +#@see ogBootLoaderDeleteEntry #*/ -function ogGrubDeleteEntry { +function ogGrubDeleteEntry () +{ # Si se solicita, mostrar ayuda. if [ "$*" == "help" ]; then ogHelp "$FUNCNAME" "$FUNCNAME int_ndisk int_npartition int_disk_delete int_npartition_delete" \ @@ -1277,9 +1291,11 @@ function ogGrubDeleteEntry { #/** # ogBurgDeleteEntry num_disk num_part num_disk_delete num_part_delete +#@brief ver ogBootLoaderDeleteEntry #@see ogBootLoaderDeleteEntry #*/ -function ogBurgDeleteEntry { +function ogBurgDeleteEntry () +{ # Si se solicita, mostrar ayuda. if [ "$*" == "help" ]; then ogHelp "$FUNCNAME" "$FUNCNAME int_ndisk int_npartition int_disk_delete int_npartition_delete" \ @@ -1305,8 +1321,10 @@ function ogBurgDeleteEntry { #@version 1.1 Se generaliza la función para grub y burg #@author Irina Gomez, ETSII Universidad de Sevilla #@date 2017-10-20 -#*/ -function ogBootLoaderDeleteEntry { +#*/ ## + +function ogBootLoaderDeleteEntry () +{ local FUNC DIRMOUNT CFGFILE DEVICE MENUENTRY DELETEENTRY ENDENTRY ENTRY # Si se solicita, mostrar ayuda. @@ -1368,7 +1386,7 @@ function ogBootLoaderDeleteEntry { done } - +#/** # ogBurgInstallMbr int_disk_GRUBCFG int_partition_GRUBCFG #@param bolean_Check_Os_installed_and_Configure_2ndStage true | false[default] #@brief Instala y actualiza el gestor grub en el MBR del disco duro donde se encuentra el fichero grub.cfg. Admite sistemas Windows. @@ -1387,9 +1405,13 @@ function ogBootLoaderDeleteEntry { #@version 1.1.0 - Refactorizar fichero de configuacion #@author Antonio J. Doblas Viso. Universidad de Malaga. #@date 2018-01-24 +#@version 1.1.1 - Se incluye comentarios en codigo para autodocuemtnacion con Doxygen +#@author Antonio J. Doblas Viso. Universidad de Malaga. +#@date 2018-07-05 #*/ ## -function ogBurgInstallMbr { +function ogBurgInstallMbr () +{ # Variables locales. local PART DISK FIRSTAGE SECONSTAGE PREFIXSECONDSTAGE CHECKOS KERNELPARAM BACKUPNAME FILECFG @@ -1422,7 +1444,7 @@ FIRSTSTAGE=$(ogDiskToDev 1) SECONDSTAGE=$(ogMount $DISK $PART) # prepara el directorio principal de la segunda etapa (y copia los binarios) -[ -d ${SECONDSTAGE}/boot/burg/ ] || mkdir -p ${SECONDSTAGE}/boot/burg/; cp -prv /boot/burg/* ${SECONDSTAGE}/boot/burg/ 2>&1>/dev/null; cp -prv $OGLIB/burg/* ${SECONDSTAGE}/boot/burg/ 2>&1>/dev/null; +[ -d ${SECONDSTAGE}/boot/burg/ ] || mkdir -p ${SECONDSTAGE}/boot/burg/; cp -prv /boot/burg/* ${SECONDSTAGE}/boot/burg/ 2>&1>/dev/null; cp -prv $OGLIB/burg/* ${SECONDSTAGE}/boot/burg/ 2>&1>/dev/null; #*/ ## (comentario Dogygen) #*/ ## (comentario Dogygen) #Copiamos el tema mkdir -p ${SECONDSTAGE}/boot/burg/themes/OpenGnsys @@ -1459,6 +1481,7 @@ mkdir -p ${SECONDSTAGE}${PREFIXSECONDSTAGE}/boot/burg/ FILECFG=${SECONDSTAGE}${PREFIXSECONDSTAGE}/boot/burg/burg.cfg +#/* ## (comentario Dogygen) cat > "$FILECFG" << EOF set theme_name=OpenGnsys @@ -1541,7 +1564,7 @@ fi EOF - +#*/ ## (comentario Dogygen) #Preparar configuración segunda etapa: crear entrada del sistema operativo grubSyntax "$KERNELPARAM" >> "$FILECFG" @@ -1553,9 +1576,11 @@ burg-install --force --root-directory=${SECONDSTAGE} $FIRSTSTAGE 2>&1>/dev/null #/** # ogGrubDefaultEntry int_disk_GRUGCFG int_partition_GRUBCFG int_disk_default_entry int_npartition_default_entry +#@brief ver ogBootLoaderDefaultEntry #@see ogBootLoaderDefaultEntry -#*/ -function ogGrubDefaultEntry { +#*/ ## +function ogGrubDefaultEntry () +{ # Si se solicita, mostrar ayuda. if [ "$*" == "help" ]; then ogHelp "$FUNCNAME" "$FUNCNAME int_ndisk int_npartition int_disk_default_entry int_npartition_default_entry" \ @@ -1568,9 +1593,11 @@ function ogGrubDefaultEntry { #/** # ogBurgDefaultEntry int_disk_BURGCFG int_partition_BURGCFG int_disk_default_entry int_npartition_default_entry +#@brief ver ogBootLoaderDefaultEntry #@see ogBootLoaderDefaultEntry -#*/ -function ogBurgDefaultEntry { +#*/ ## +function ogBurgDefaultEntry () +{ # Si se solicita, mostrar ayuda. if [ "$*" == "help" ]; then ogHelp "$FUNCNAME" "$FUNCNAME int_ndisk int_npartition int_disk_default_entry int_npartition_default_entry" \ @@ -1600,7 +1627,8 @@ function ogBurgDefaultEntry { #@author Irina Gomez, ETSII Universidad de Sevilla #@date 2018-01-04 #*/ ## -function ogBootLoaderDefaultEntry { +function ogBootLoaderDefaultEntry () +{ # Variables locales. local PART CFGFILE DEFAULTENTRY MSG @@ -1652,18 +1680,18 @@ DEFAULTENTRY=$(grep -n -m 1 menuentry.*$DEVICE $CFGFILE| cut -d: -f1) MENUENTRY="$(grep -n -e menuentry $CFGFILE| cut -d: -f1 | grep -n $DEFAULTENTRY |cut -d: -f1)" # Las líneas empiezan a contar desde cero let MENUENTRY=$MENUENTRY-1 - sed --regexp-extended -i s/"set default=\"?[0-9]*\"?"/"set default=\"$MENUENTRY\""/g $CFGFILE - MSG="MSG_HELP_$FUNC" echo "${!MSG%%\.}: $@" } #/** # ogGrubOgliveDefaultEntry num_disk num_part +#@brief ver ogBootLoaderOgliveDefaultEntry #@see ogBootLoaderOgliveDefaultEntry -#*/ -function ogGrubOgliveDefaultEntry { +#*/ ## +function ogGrubOgliveDefaultEntry () +{ # Si se solicita, mostrar ayuda. if [ "$*" == "help" ]; then ogHelp "$FUNCNAME" "$FUNCNAME int_ndiskSecondStage int_partitionSecondStage" \ @@ -1676,9 +1704,11 @@ function ogGrubOgliveDefaultEntry { #/** # ogBurgOgliveDefaultEntry num_disk num_part +#@brief ver ogBootLoaderOgliveDefaultEntry #@see ogBootLoaderOgliveDefaultEntry -#*/ -function ogBurgOgliveDefaultEntry { +#*/ ## +function ogBurgOgliveDefaultEntry () +{ # Si se solicita, mostrar ayuda. if [ "$*" == "help" ]; then ogHelp "$FUNCNAME" "$FUNCNAME int_ndiskSecondStage int_partitionSecondStage" \ @@ -1706,7 +1736,8 @@ function ogBurgOgliveDefaultEntry { #@author Irina Gomez, ETSII Universidad de Sevilla #@date 2018-01-04 #*/ ## -function ogBootLoaderOgliveDefaultEntry { +function ogBootLoaderOgliveDefaultEntry () +{ # Variables locales. local FUNC PART CFGFILE NUMENTRY MSG @@ -1759,9 +1790,11 @@ echo "${!MSG%%\.}: $@" #/** # ogGrubSetTheme num_disk num_part str_theme +#@brief ver ogBootLoaderSetTheme #@see ogBootLoaderSetTheme -#*/ -function ogGrubSetTheme { +#*/ ## +function ogGrubSetTheme () +{ # Si se solicita, mostrar ayuda. if [ "$*" == "help" ]; then ogHelp "$FUNCNAME" "$FUNCNAME int_ndiskSecondStage int_partitionSecondStage str_themeName" \ @@ -1775,9 +1808,11 @@ function ogGrubSetTheme { #/** # ogBurgSetTheme num_disk num_part str_theme +#@brief ver ogBootLoaderSetTheme #@see ogBootLoaderSetTheme -#*/ -function ogBurgSetTheme { +#*/ ## +function ogBurgSetTheme () +{ # Si se solicita, mostrar ayuda. if [ "$*" == "help" ]; then ogHelp "$FUNCNAME" "$FUNCNAME int_ndiskSecondStage int_partitionSecondStage str_themeName" \ @@ -1808,7 +1843,8 @@ function ogBurgSetTheme { #@author Antonio J. Doblas Viso. Universidad de Malaga #@date 2018-01-24 #*/ ## -function ogBootLoaderSetTheme { +function ogBootLoaderSetTheme () +{ # Variables locales. local FUNC PART CFGFILE THEME NEWTHEME BOOTLOADER MSG @@ -1880,9 +1916,11 @@ sed --regexp-extended -i s/"$THEME"/"$NEWTHEME"/g $CFGFILE #/** # ogGrubSetAdminKeys num_disk num_part str_theme +#@brief ver ogBootLoaderSetTheme #@see ogBootLoaderSetTheme -#*/ -function ogGrubSetAdminKeys { +#*/ ## +function ogGrubSetAdminKeys () +{ # Si se solicita, mostrar ayuda. if [ "$*" == "help" ]; then ogHelp "$FUNCNAME" "$FUNCNAME int_ndiskSecondStage int_partitionSecondStage str_bolean" \ @@ -1896,9 +1934,11 @@ function ogGrubSetAdminKeys { #/** # ogBurgSetAdminKeys num_disk num_part str_bolean +#@brief ver ogBootLoaderSetAdminKeys #@see ogBootLoaderSetAdminKeys -#*/ -function ogBurgSetAdminKeys { +#*/ ## +function ogBurgSetAdminKeys () +{ # Si se solicita, mostrar ayuda. if [ "$*" == "help" ]; then ogHelp "$FUNCNAME" "$FUNCNAME int_ndiskSecondStage int_partitionSecondStage str_bolean" \ @@ -1927,7 +1967,8 @@ function ogBurgSetAdminKeys { #@author Antonio J. Doblas Viso. Universidad de Malaga #@date 2018-01-24 #*/ ## -function ogBootLoaderSetAdminKeys { +function ogBootLoaderSetAdminKeys () +{ # Variables locales. local FUNC PART CFGFILE BOOTLOADER BOOTLOADERDIR CFGFILE MSG @@ -1992,9 +2033,11 @@ esac #/** # ogGrubSetTimeOut num_disk num_part int_timeout_seconds +#@brief ver ogBootLoaderSetTimeOut #@see ogBootLoaderSetTimeOut -#*/ -function ogGrubSetTimeOut { +#*/ ## +function ogGrubSetTimeOut () +{ # Si se solicita, mostrar ayuda. if [ "$*" == "help" ]; then ogHelp "$FUNCNAME" "$FUNCNAME int_ndiskSecondStage int_partitionSecondStage int_timeout_seconds" \ @@ -2008,9 +2051,11 @@ function ogGrubSetTimeOut { #/** # ogBurgSetTimeOut num_disk num_part str_bolean +#@brief ver ogBootLoaderSetTimeOut #@see ogBootLoaderSetTimeOut -#*/ -function ogBurgSetTimeOut { +#*/ ## +function ogBurgSetTimeOut () +{ # Si se solicita, mostrar ayuda. if [ "$*" == "help" ]; then ogHelp "$FUNCNAME" "$FUNCNAME int_ndiskSecondStage int_partitionSecondStage str_timeout_seconds" \ @@ -2039,7 +2084,8 @@ function ogBurgSetTimeOut { #@author Antonio J. Doblas Viso. Universidad de Malaga #@date 2018-01-24 #*/ ## -function ogBootLoaderSetTimeOut { +function ogBootLoaderSetTimeOut () +{ # Variables locales. local FUNC PART CFGFILE TIMEOUT BOOTLOADER BOOTLOADERDIR CFGFILE MSG @@ -2089,9 +2135,11 @@ sed -i s/timeout=.*$/timeout=$TIMEOUT/g $CFGFILE #/** # ogGrubSetResolution num_disk num_part int_resolution +#@brief ver ogBootLoaderSetResolution #@see ogBootLoaderSetResolution -#*/ -function ogGrubSetResolution { +#*/ ## +function ogGrubSetResolution () +{ # Si se solicita, mostrar ayuda. if [ "$*" == "help" ]; then ogHelp "$FUNCNAME" "$FUNCNAME int_ndiskSecondStage int_partitionSecondStage [str_resolution]" \ @@ -2106,9 +2154,11 @@ function ogGrubSetResolution { #/** # ogBurgSetResolution num_disk num_part str_bolean +#@brief ver ogBootLoaderSetResolution #@see ogBootLoaderSetResolution -#*/ -function ogBurgSetResolution { +#*/ ## +function ogBurgSetResolution () + { # Si se solicita, mostrar ayuda. if [ "$*" == "help" ]; then ogHelp "$FUNCNAME" "$FUNCNAME int_ndiskSecondStage int_partitionSecondStage [str_resolution]" \ @@ -2137,7 +2187,8 @@ function ogBurgSetResolution { #@author Antonio J. Doblas Viso. Universidad de Malaga #@date 2018-01-24 #*/ ## -function ogBootLoaderSetResolution { +function ogBootLoaderSetResolution () +{ # Variables locales. local FUNC PART CFGFILE RESOLUTION NEWRESOLUTION DEFAULTRESOLUTION BOOTLOADER BOOTLOADERDIR CFGFILE MSG @@ -2220,7 +2271,7 @@ fi sed -i s/gfxmode=.*$/gfxmode=$NEWRESOLUTION/g $CFGFILE } - +#/** # ogRefindInstall int_ndisk bool_autoconfig #@brief Instala y actualiza el gestor rEFInd en la particion EFI #@param int_ndisk @@ -2231,7 +2282,8 @@ sed -i s/gfxmode=.*$/gfxmode=$NEWRESOLUTION/g $CFGFILE #@author Juan Carlos Garcia. Universidad de ZAragoza. #@date 2017-06-26 #*/ ## -function ogRefindInstall { +function ogRefindInstall () +{ # Variables locales. local DISK EFIDIR CONFIG EFIPARTITIONID diff --git a/client/engine/Cache.lib b/client/engine/Cache.lib index 8f6c9663..0e7f51ef 100755 --- a/client/engine/Cache.lib +++ b/client/engine/Cache.lib @@ -87,7 +87,7 @@ SIZE=$[$SIZECACHE*2] # Tamaño en sectores de 512 B. IOSIZE=$(fdisk -l $DISK | awk '/I\/O/ {print $4}') if [ $IOSIZE -eq 4096 ]; then END=$[$END-8192] - START=$[END-SIZE-8192] + START=$[END-SIZE+2048-(END-SIZE)%2048] else START=$[END-SIZE+1] fi diff --git a/client/engine/Disk.lib b/client/engine/Disk.lib index 7f46d789..010dfc3a 100755 --- a/client/engine/Disk.lib +++ b/client/engine/Disk.lib @@ -73,15 +73,17 @@ SECTORS=$(ogGetLastSector $1) # Se recalcula el nº de sectores del disco 1, si existe partición de caché. CACHEPART=$(ogFindCache 2>/dev/null) [ "$ND" = "${CACHEPART% *}" ] && CACHESIZE=$(ogGetCacheSize 2>/dev/null | awk '{print $0*2}') -[ -n "$CACHESIZE" ] && SECTORS=$[SECTORS-CACHESIZE] # Sector de inicio (la partición 1 empieza en el sector 63). IODISCO=$(ogDiskToDev $1) IOSIZE=$(fdisk -l $IODISCO | awk '/I\/O/ {print $4}') if [ "$IOSIZE" == "4096" ]; then START=4096 + SECTORS=$[SECTORS-8192] + [ -n "$CACHESIZE" ] && SECTORS=$[SECTORS-CACHESIZE+2048-(SECTORS-CACHESIZE)%2048-1] else START=63 + [ -n "$CACHESIZE" ] && SECTORS=$[SECTORS-CACHESIZE] fi PART=1 @@ -126,6 +128,9 @@ while [ $# -gt 0 ]; do echo "$DISK$PART : start=$START, size=$SIZE, Id=$ID" >>$tmpsfdisk # Error si se supera el nº total de sectores. START=$[START+SIZE] + if [ "$IOSIZE" == "4096" -a $PART -gt 4 ]; then + START=$[START+2048] + fi [ $START -le $SECTORS ] || ogRaiseError $OG_ERR_FORMAT "$[START/2] > $[SECTORS/2]" || return $? PART=$[PART+1] shift diff --git a/client/engine/File.lib b/client/engine/File.lib index f37e947d..1be1a338 100755 --- a/client/engine/File.lib +++ b/client/engine/File.lib @@ -229,7 +229,11 @@ rm -fr "$DIR" || ogRaiseError $OG_ERR_NOTFOUND "$*" || return $? #@version 0.9 - Pruebas con OpenGnSys. #@author Ramon Gomez, ETSII Universidad de Sevilla #@date 2009-09-15 +#@version 1.1.1 - Correccion comentarios autodocumentacion doxygen . +#@author Antonio J. Doblas Viso. Universidad de Malaga +#@date 2018-07-05 #*/ ## + function ogGetPath () { # Variables locales. @@ -266,7 +270,7 @@ case $# in esac # Eliminar caracteres \c / duplicados y finales. - # /* (comentario Doxygen) + FILE="$(echo $FILE|sed -e 's/\(\/\)*\1/\//g; s/\/$//')" # Comprobar si existe el fichero para reducir tiempos. if [ -e "$FILE" ]; then @@ -274,13 +278,14 @@ if [ -e "$FILE" ]; then else # Buscar el nombre correcto en cada subdirectorio del camino. FILEPATH="/" + while [ "$FILE" != "$PREVFILE" ]; do - FILEPATH="$(ls -d "${FILEPATH%/}/${FILE%%/*}" 2>/dev/null || find "$FILEPATH" -maxdepth 1 -iname "${FILE%%/*}" -print 2>/dev/null)" + FILEPATH="$(ls -d "${FILEPATH%/}/${FILE%%/*}" 2>/dev/null || find "$FILEPATH" -maxdepth 1 -iname "${FILE%%/*}" -print 2>/dev/null)" #*/ (Comentario Doxygen) PREVFILE="$FILE" - FILE="${FILE#*/}" + FILE="${FILE#*/}" done + fi - # (comentario Doxygen) */ [ -n "$FILEPATH" ] && echo "$FILEPATH" return 0 } @@ -294,6 +299,7 @@ return 0 #@author Ramon Gomez, ETSII Universidad de Sevilla #@date 2009-09-29 #*/ ## + function ogGetParentPath () { local PARENT diff --git a/client/engine/FileSystem.lib b/client/engine/FileSystem.lib index 868642fd..0642a854 100755 --- a/client/engine/FileSystem.lib +++ b/client/engine/FileSystem.lib @@ -602,7 +602,8 @@ test -n "$(ogGetMountPoint $1 $2)" #@version 1.1.0 - Primera versión para OpenGnsys. #@author Ramon Gomez, ETSII Universidad de Sevilla #@date 2016-01-20 -#/** +#*/ ## + function ogIsReadonly () { # Variables locales @@ -631,7 +632,7 @@ test -n "$(findmnt -n -o OPTIONS $PART | awk 'BEGIN {RS=","} /^ro$/ {print}')" #@version 1.0.5 - Primera versión para OpenGnSys. #@author Ramon Gomez, ETSII Universidad de Sevilla #@date 2013-10-09 -#/** +#*/ ## function ogIsWritable () { # Variables locales @@ -1145,8 +1146,23 @@ case "$(ogGetFsType $1 $2)" in esac } -# AVISO: Componer corretcamente esta función. -function ogGetFreeSize () { + +#/** +# ogGetFreeSize int_disco int_partition str_SizeOutput +#@brief muestra informacion del tamaño total, datos y libre. +#@param int_ndisk nº de orden del disco +#@param int_npart nº de orden de partición +#@param str_unitSize unidad mostrada +#@return int_size:int_data:int_free +#@TODO Componer corretcamente esta función. +#@exception OG_ERR_FORMAT Formato incorrecto. +#@version +#@author +#@date +#*/ ## + +function ogGetFreeSize () +{ local particion unit factor valor if [ $# = 0 ] then diff --git a/client/engine/Image.lib b/client/engine/Image.lib index 092befed..20e7f7df 100755 --- a/client/engine/Image.lib +++ b/client/engine/Image.lib @@ -664,6 +664,8 @@ IMGFILE=$(ogGetPath "$1" "$2.$IMGTYPE") # comprobamos consistencia de la imagen ogGetImageInfo $IMGFILE >/dev/null || return $(ogRaiseError $OG_ERR_IMAGE " $1 $2"; echo $?) + +#/* (Comienzo comentario Doxygen) # Error si la imagen no cabe en la particion. #IMGSIZE=$(ogGetImageSize "$1" "$2") || return $(ogRaiseError $OG_ERR_IMAGE " $1 $2"; echo $?) #DISKSIZE=$(ogGetDiskSize $3) @@ -671,6 +673,8 @@ ogGetImageInfo $IMGFILE >/dev/null || return $(ogRaiseError $OG_ERR_IMAGE " $1 # ogRaiseError $OG_ERR_IMGSIZEPARTITION "$DISKSIZE < $IMGSIZE" # return $? #fi +#*/ (Fin comentario Doxygen) + # Comprobar el bloqueo de la imagen y de la partición. if ogIsImageLocked "$IMGFILE"; then ogRaiseError $OG_ERR_LOCKED "$MSG_IMAGE $1, $2.$IMGTYPE" @@ -1002,6 +1006,20 @@ else fi } +#/** +# ogGetImageProgram str_REPO str_imagen +#@brief muestra información sobre la imagen monolitica. +#@see ogGetImageInfo +#@param 1 REPO o CACHE contenedor de la imagen +#@param 2 filename nombre de la imagen sin extension +#@return nombre del programa usado para generar la imagen +#@exception OG_ERR_FORMAT formato incorrecto. +#@exception OG_ERR_NOTFOUND fichero no encontrado. +#@note ogGetImageProgram REPO imagenA -> partclone +#@version 1.0 - Primeras pruebas +#@author Antonio J. Doblas Viso. Universidad de Málaga +#@date 2010/02/08 +#*/ ## function ogGetImageProgram () { @@ -1019,7 +1037,20 @@ IMGFILE=$(ogGetPath "$1" "$2.img") ogGetImageInfo $IMGFILE | awk -F: '{print $1}' } - +#/** +# ogGetImageCompressor str_REPO str_imagen +#@brief muestra información sobre la imagen monolitica. +#@see ogGetImageInfo +#@param 1 REPO o CACHE contenedor de la imagen +#@param 2 filename nombre de la imagen sin extension +#@return tipo de compresión usada al generar la imagen +#@exception OG_ERR_FORMAT formato incorrecto. +#@exception OG_ERR_NOTFOUND fichero no encontrado. +#@note ogGetImageCompressor REPO imagenA -> lzop +#@version 1.0 - Primeras pruebas +#@author Antonio J. Doblas Viso. Universidad de Málaga +#@date 2010/02/08 +#*/ ## function ogGetImageCompressor () { local IMGFILE @@ -1037,6 +1068,20 @@ ogGetImageInfo $IMGFILE | awk -F: '{print $2}' } +#/** +# ogGetImageType str_REPO str_imagen +#@brief muestra información sobre el sistema de archivos de imagen monolitica. +#@see ogGetImageInfo +#@param 1 REPO o CACHE contenedor de la imagen +#@param 2 filename nombre de la imagen sin extension +#@return tipo de compresión usada al generar la imagen +#@exception OG_ERR_FORMAT formato incorrecto. +#@exception OG_ERR_NOTFOUND fichero no encontrado. +#@note ogGetImageType REPO imagenA -> NTFS +#@version 1.0 - Primeras pruebas +#@author Antonio J. Doblas Viso. Universidad de Málaga +#@date 2010/02/08 +#*/ ## function ogGetImageType () { local IMGFILE @@ -1054,6 +1099,20 @@ ogGetImageInfo $IMGFILE | awk -F: '{print $3}' } +#/** +# ogGetImageSize str_REPO str_imagen +#@brief muestra información sobre el tamaño (KB) del sistema de archivos de imagen monolitica. +#@see ogGetImageInfo +#@param 1 REPO o CACHE contenedor de la imagen +#@param 2 filename nombre de la imagen sin extension +#@return tipo de compresión usada al generar la imagen +#@exception OG_ERR_FORMAT formato incorrecto. +#@exception OG_ERR_NOTFOUND fichero no encontrado. +#@note ogGetImagesize REPO imagenA -> 56432234 > Kb +#@version 1.0 - Primeras pruebas +#@author Antonio J. Doblas Viso. Universidad de Málaga +#@date 2010/02/08 +#*/ ## function ogGetImageSize () { # Variables locales diff --git a/client/engine/Inventory.lib b/client/engine/Inventory.lib index c2861411..853f0d18 100755 --- a/client/engine/Inventory.lib +++ b/client/engine/Inventory.lib @@ -90,168 +90,6 @@ esac } -#/** -# ogGetOsVersion int_ndisk int_nfilesys -#@brief Devuelve la versión del sistema operativo instalado en un sistema de archivos. -#@param int_ndisk nº de orden del disco -#@param int_nfilesys nº de orden de la partición -#@return OSType:OSVersion - tipo y versión del sistema operativo. -#@note OSType = { Android, BSD, GrubLoader, Hurd, Linux, MacOS, Solaris, Windows, WinLoader } -#@note Requisitos: awk, head, chroot -#@exception OG_ERR_FORMAT Formato incorrecto. -#@exception OG_ERR_NOTFOUND Disco o partición no corresponden con un dispositiv -#@exception OG_ERR_PARTITION Fallo al montar el sistema de archivos. -#@version 0.9 - Primera versión para OpenGnSys -#@author Ramon Gomez, ETSII Universidad de Sevilla -#@date 2009-09-15 -#@version 1.0.4 - Incluir tipos BSD, MacOS y Solaris. -#@author Ramon Gomez, ETSII Universidad de Sevilla -#@date 2012-06-29 -#@version 1.0.5 - Incluir tipos GrubLoader, Hurd y WinLoader, leer por defecto fichero /etc/os-release. -#@author Ramon Gomez, ETSII Universidad de Sevilla -#@date 2013-10-07 -#@version 1.0.6 - Detectar GrubLoader al final y sistemas basados en EFI. -#@author Ramon Gomez, ETSII Universidad de Sevilla -#@date 2014-08-27 -#*/ ## -function ogGetOsVersion () -{ -# Variables locales. -local MNTDIR TYPE DISTRIB VERSION IS64BIT FILE -# Si se solicita, mostrar ayuda. -if [ "$*" == "help" ]; then - ogHelp "$FUNCNAME" "$FUNCNAME int_ndisk int_nfilesys" \ - "$FUNCNAME 1 2 => Linux:Ubuntu precise (12.04 LTS) 64 bits" - return -fi -# Error si no se reciben 2 parametros. -[ $# = 2 ] || ogRaiseError $OG_ERR_FORMAT || return $? - -# Montar la particion, si no lo estaba previamente. -MNTDIR=$(ogMount $1 $2) || return $? - -# Buscar tipo de sistema operativo. -# Para GNU/Linux: leer descripción. -TYPE="Linux" -FILE="$MNTDIR/etc/os-release" -[ -r $FILE ] && VERSION="$(awk -F= '$1~/PRETTY_NAME/ {gsub(/\"/,"",$2); print $2}' $FILE)" -# Si no se puede obtener, buscar en ficheros del sistema. -if [ -z "$VERSION" ]; then - FILE="$MNTDIR/etc/lsb-release" - [ -r $FILE ] && VERSION="$(awk -F= '$1~/DESCRIPTION/ {gsub(/\"/,"",$2); print $2}' $FILE)" - for DISTRIB in redhat SuSE mandrake gentoo; do - FILE="$MNTDIR/etc/${DISTRIB}-release" - [ -r $FILE ] && VERSION="$(head -1 $FILE)" - done - FILE="$MNTDIR/etc/arch-release" - [ -r $FILE ] && VERSION="Arch Linux" - FILE="$MNTDIR/etc/slackware-version" - [ -r $FILE ] && VERSION="Slackware $(cat $FILE)" -fi -# Si no se encuentra, intentar ejecutar "lsb_release". -[ -z "$VERSION" ] && VERSION=$(chroot $MNTDIR lsb_release -d 2>/dev/null | awk -F":\t" '{print $2}') -# Comprobar Linux de 64 bits. -[ -n "$VERSION" ] && [ -e $MNTDIR/lib64 ] && IS64BIT="$MSG_64BIT" -# Para Android, leer fichero de propiedades. -if [ -z "$VERSION" ]; then - TYPE="Android" - FILE="$MNTDIR/android*/system/build.prop" - [ -r $FILE ] && VERSION="Android $(awk -F= '$1~/(product.brand|build.version.release)/ {print $2}' $FILE | tr '\n' ' ')" - [ -e $MNTDIR/lib64 ] && IS64BIT="$MSG_64BIT" -fi -# Para GNU/Hurd, comprobar fichero de inicio (basado en os-prober). -if [ -z "$VERSION" ]; then - TYPE="Hurd" - FILE="$MNTDIR/hurd/init" - [ -r $FILE ] && VERSION="GNU/Hurd" -fi -# Para Windows: leer la version del registro. -if [ -z "$VERSION" ]; then - TYPE="Windows" - FILE="$(ogGetHivePath $MNTDIR SOFTWARE)" - if [ -n "$FILE" ]; then - # Nuevo método más rápido para acceder al registro de Windows.. - VERSION=$(echo $(hivexsh << EOT 2>/dev/null -load $FILE -cd \Microsoft\Windows NT\CurrentVersion -lsval ProductName -lsval ReleaseId -EOT - )) - [ -n "$(reglookup -H -p "Microsoft/Windows/CurrentVersion/ProgramW6432Dir" "$FILE" 2>/dev/null)" ] && IS64BIT="$MSG_64BIT" - if [ -z "$VERSION" ]; then - # Compatibilidad con métrodo antiguo y más lento de acceder al registro. - VERSION=$(ogGetRegistryValue $MNTDIR software '\Microsoft\Windows NT\CurrentVersion\ProductName' 2>/dev/null) - [ -n "$(ogGetRegistryValue $MNTDIR software '\Microsoft\Windows\CurrentVersion\ProgramW6432Dir' 2>/dev/null)" ] && IS64BIT="$MSG_64BIT" - fi - fi -fi -# Para cargador Windows: buscar versión en fichero BCD (basado en os-prober). -if [ -z "$VERSION" ]; then - TYPE="WinLoader" - FILE="$(ogGetPath $MNTDIR/boot/bcd)" - [ -z "$FILE" ] && FILE="$(ogGetPath $MNTDIR/EFI/Microsoft/boot/bcd)" - if [ -n "$FILE" ]; then - for DISTRIB in "Windows Recovery" "Windows Boot"; do - if grep -aqs "$(echo "$DISTRIB" | sed 's/./&./g')" $FILE; then - VERSION="$DISTRIB loader" - fi - done - fi -fi -# Para macOS: detectar kernel y completar con fichero plist de información del sistema. -if [ -z "$VERSION" ]; then - TYPE="MacOS" - # Kernel de Mac OS (no debe ser fichero de texto). - FILE="$MNTDIR/mach_kernel" - if [ -z "$(file -b $FILE | grep 'text')" ]; then - # Obtener tipo de kernel. - [ -n "$(file -b $FILE | grep 'Mach-O')" ] && VERSION="macOS" - [ -n "$(file -b $FILE | grep 'Mach-O 64-bit')" ] && IS64BIT="$MSG_64BIT" - # Datos de configuración de versión de Mac OS. - FILE="$MNTDIR/System/Library/CoreServices/SystemVersion.plist" - [ -r $FILE ] && VERSION=$(awk -F"[<>]" ' - /ProductName/ {getline;s=$3} - /ProductVersion/ {getline;v=$3} - END {print s,v}' $FILE) - # Datos de recuperación de macOS. - FILE="$MNTDIR/com.apple.recovery.boot" - [ -r $FILE -a -n "$VERSION" ] && VERSION="$VERSION recovery" - fi -fi -# Para FreeBSD: obtener datos del Kernel. -### TODO Revisar solución. -if [ -z "$VERSION" ]; then - TYPE="BSD" - FILE="$MNTDIR/boot/kernel/kernel" - if [ -r $FILE ]; then - VERSION="$(strings $FILE|awk '/@.*RELEASE/ {sub(/@\(#\)/,""); print $1,$2}')" - [ -n "$(file -b $FILE | grep 'x86-64')" ] && IS64BIT="$MSG_64BIT" - fi -fi -# Para Solaris: leer el fichero de versión. -### TODO Revisar solución. -if [ -z "$VERSION" ]; then - TYPE="Solaris" - FILE="$MNTDIR/etc/release" - [ -r $FILE ] && VERSION="$(head -1 $FILE)" -fi -# Para cargador GRUB, comprobar fichero de configuración. -if [ -z "$VERSION" ]; then - TYPE="GrubLoader" - for FILE in $MNTDIR/{,boot/}grub/menu.lst; do - [ -r $FILE ] && VERSION="GRUB Loader" - done - for FILE in $MNTDIR/{,boot/}{grub{,2},EFI/*}/grub.cfg; do - [ -r $FILE ] && VERSION="GRUB2 Loader" - done -fi - -# Mostrar resultado y salir sin errores. -[ -n "$VERSION" ] && echo "$TYPE:$VERSION $IS64BIT" -return 0 -} - #/** # ogGetSerialNumber @@ -259,6 +97,8 @@ return 0 #@version 1.1.0 - Primeras versión con OpenGnsys #@author Ramon Gomez, ETSII Universidad de Sevilla #@date 2015-06-08 +#*/ ## + function ogGetSerialNumber () { # Si se solicita, mostrar ayuda. @@ -497,3 +337,166 @@ for k in db.keys(): return $? ;; esac } + +#/** +# ogGetOsVersion int_ndisk int_nfilesys +#@brief Devuelve la versión del sistema operativo instalado en un sistema de archivos. +#@param int_ndisk nº de orden del disco +#@param int_nfilesys nº de orden de la partición +#@return OSType:OSVersion - tipo y versión del sistema operativo. +#@note OSType = { Android, BSD, GrubLoader, Hurd, Linux, MacOS, Solaris, Windows, WinLoader } +#@note Requisitos: awk, head, chroot +#@exception OG_ERR_FORMAT Formato incorrecto. +#@exception OG_ERR_NOTFOUND Disco o partición no corresponden con un dispositiv +#@exception OG_ERR_PARTITION Fallo al montar el sistema de archivos. +#@version 0.9 - Primera versión para OpenGnSys +#@author Ramon Gomez, ETSII Universidad de Sevilla +#@date 2009-09-15 +#@version 1.0.4 - Incluir tipos BSD, MacOS y Solaris. +#@author Ramon Gomez, ETSII Universidad de Sevilla +#@date 2012-06-29 +#@version 1.0.5 - Incluir tipos GrubLoader, Hurd y WinLoader, leer por defecto fichero /etc/os-release. +#@author Ramon Gomez, ETSII Universidad de Sevilla +#@date 2013-10-07 +#@version 1.0.6 - Detectar GrubLoader al final y sistemas basados en EFI. +#@author Ramon Gomez, ETSII Universidad de Sevilla +#@date 2014-08-27 +#*/ ## +function ogGetOsVersion () +{ +# Variables locales. +local MNTDIR TYPE DISTRIB VERSION IS64BIT FILE +# Si se solicita, mostrar ayuda. +if [ "$*" == "help" ]; then + ogHelp "$FUNCNAME" "$FUNCNAME int_ndisk int_nfilesys" \ + "$FUNCNAME 1 2 => Linux:Ubuntu precise (12.04 LTS) 64 bits" + return +fi +# Error si no se reciben 2 parametros. +[ $# = 2 ] || ogRaiseError $OG_ERR_FORMAT || return $? + +# Montar la particion, si no lo estaba previamente. +MNTDIR=$(ogMount $1 $2) || return $? + +# Buscar tipo de sistema operativo. +# Para GNU/Linux: leer descripción. +TYPE="Linux" +FILE="$MNTDIR/etc/os-release" +[ -r $FILE ] && VERSION="$(awk -F= '$1~/PRETTY_NAME/ {gsub(/\"/,"",$2); print $2}' $FILE)" +# Si no se puede obtener, buscar en ficheros del sistema. +if [ -z "$VERSION" ]; then + FILE="$MNTDIR/etc/lsb-release" + [ -r $FILE ] && VERSION="$(awk -F= '$1~/DESCRIPTION/ {gsub(/\"/,"",$2); print $2}' $FILE)" + for DISTRIB in redhat SuSE mandrake gentoo; do + FILE="$MNTDIR/etc/${DISTRIB}-release" + [ -r $FILE ] && VERSION="$(head -1 $FILE)" + done + FILE="$MNTDIR/etc/arch-release" + [ -r $FILE ] && VERSION="Arch Linux" + FILE="$MNTDIR/etc/slackware-version" + [ -r $FILE ] && VERSION="Slackware $(cat $FILE)" +fi +# Si no se encuentra, intentar ejecutar "lsb_release". +[ -z "$VERSION" ] && VERSION=$(chroot $MNTDIR lsb_release -d 2>/dev/null | awk -F":\t" '{print $2}') +# Comprobar Linux de 64 bits. +[ -n "$VERSION" ] && [ -e $MNTDIR/lib64 ] && IS64BIT="$MSG_64BIT" +# Para Android, leer fichero de propiedades. +if [ -z "$VERSION" ]; then + TYPE="Android" + FILE="$MNTDIR/android*/system/build.prop" + [ -r $FILE ] && VERSION="Android $(awk -F= '$1~/(product.brand|build.version.release)/ {print $2}' $FILE | tr '\n' ' ')" + [ -e $MNTDIR/lib64 ] && IS64BIT="$MSG_64BIT" +fi +# Para GNU/Hurd, comprobar fichero de inicio (basado en os-prober). +if [ -z "$VERSION" ]; then + TYPE="Hurd" + FILE="$MNTDIR/hurd/init" + [ -r $FILE ] && VERSION="GNU/Hurd" +fi +# Para Windows: leer la version del registro. +if [ -z "$VERSION" ]; then + TYPE="Windows" + FILE="$(ogGetHivePath $MNTDIR SOFTWARE)" + if [ -n "$FILE" ]; then + # Nuevo método más rápido para acceder al registro de Windows.. + VERSION=$(echo $(hivexsh << EOT 2>/dev/null +load $FILE +cd \Microsoft\Windows NT\CurrentVersion +lsval ProductName +lsval ReleaseId +EOT + )) + [ -n "$(reglookup -H -p "Microsoft/Windows/CurrentVersion/ProgramW6432Dir" "$FILE" 2>/dev/null)" ] && IS64BIT="$MSG_64BIT" + if [ -z "$VERSION" ]; then + # Compatibilidad con métrodo antiguo y más lento de acceder al registro. + VERSION=$(ogGetRegistryValue $MNTDIR software '\Microsoft\Windows NT\CurrentVersion\ProductName' 2>/dev/null) + [ -n "$(ogGetRegistryValue $MNTDIR software '\Microsoft\Windows\CurrentVersion\ProgramW6432Dir' 2>/dev/null)" ] && IS64BIT="$MSG_64BIT" + fi + fi +fi +# Para cargador Windows: buscar versión en fichero BCD (basado en os-prober). +if [ -z "$VERSION" ]; then + TYPE="WinLoader" + FILE="$(ogGetPath $MNTDIR/boot/bcd)" + [ -z "$FILE" ] && FILE="$(ogGetPath $MNTDIR/EFI/Microsoft/boot/bcd)" + if [ -n "$FILE" ]; then + for DISTRIB in "Windows Recovery" "Windows Boot"; do + if grep -aqs "$(echo "$DISTRIB" | sed 's/./&./g')" $FILE; then + VERSION="$DISTRIB loader" + fi + done + fi +fi +# Para macOS: detectar kernel y completar con fichero plist de información del sistema. +if [ -z "$VERSION" ]; then + TYPE="MacOS" + # Kernel de Mac OS (no debe ser fichero de texto). + FILE="$MNTDIR/mach_kernel" + if [ -z "$(file -b $FILE | grep 'text')" ]; then + # Obtener tipo de kernel. + [ -n "$(file -b $FILE | grep 'Mach-O')" ] && VERSION="macOS" + [ -n "$(file -b $FILE | grep 'Mach-O 64-bit')" ] && IS64BIT="$MSG_64BIT" + # Datos de configuración de versión de Mac OS. + FILE="$MNTDIR/System/Library/CoreServices/SystemVersion.plist" + [ -r $FILE ] && VERSION=$(awk -F"[<>]" ' + /ProductName/ {getline;s=$3} + /ProductVersion/ {getline;v=$3} + END {print s,v}' $FILE) + # Datos de recuperación de macOS. + FILE="$MNTDIR/com.apple.recovery.boot" + [ -r $FILE -a -n "$VERSION" ] && VERSION="$VERSION recovery" + fi +fi +# Para FreeBSD: obtener datos del Kernel. +### TODO Revisar solución. +if [ -z "$VERSION" ]; then + TYPE="BSD" + FILE="$MNTDIR/boot/kernel/kernel" + if [ -r $FILE ]; then + VERSION="$(strings $FILE|awk '/@.*RELEASE/ {sub(/@\(#\)/,""); print $1,$2}')" + [ -n "$(file -b $FILE | grep 'x86-64')" ] && IS64BIT="$MSG_64BIT" + fi +fi +# Para Solaris: leer el fichero de versión. +### TODO Revisar solución. +if [ -z "$VERSION" ]; then + TYPE="Solaris" + FILE="$MNTDIR/etc/release" + [ -r $FILE ] && VERSION="$(head -1 $FILE)" +fi +# Para cargador GRUB, comprobar fichero de configuración. +if [ -z "$VERSION" ]; then + TYPE="GrubLoader" + for FILE in $MNTDIR/{,boot/}grub/menu.lst; do + [ -r $FILE ] && VERSION="GRUB Loader" + done +#/* (comentario Doxygen) + for FILE in $MNTDIR/{,boot/}{grub{,2},EFI/*}/grub.cfg; do + [ -r $FILE ] && VERSION="GRUB2 Loader" + done +fi +#*/ (Comentario Doxygen) +# Mostrar resultado y salir sin errores. +[ -n "$VERSION" ] && echo "$TYPE:$VERSION $IS64BIT" +return 0 +}
\ No newline at end of file diff --git a/client/engine/Net.lib b/client/engine/Net.lib index 4b3faad9..d8f272b1 100755 --- a/client/engine/Net.lib +++ b/client/engine/Net.lib @@ -19,7 +19,8 @@ #@author Irina Gomez, ETSII Universidad de Sevilla #@date 2015-06-16 #*/ -function ogChangeRepo { +function ogChangeRepo () +{ local SRCIMG NEWREPO REPO OGUNIT if [ "$*" == "help" ]; then @@ -36,6 +37,9 @@ if [ $# -lt 1 ]; then fi +# Opciones de montaje: lectura o escritura +mount |grep "ogimages.*rw," &>/dev/null && RW=",rw" || RW=",ro" + # Si REPO tomamos el repositorio y la unidad organizativa actual REPO=$(ogGetRepoIp) OGUNIT="$(df | awk -F " " '/ogimages/ {sub("//.*/ogimages","",$1); sub("/","",$1); print $1}')" @@ -52,9 +56,6 @@ umount $OGIMG [ "$2" == "" ] && SRCIMG="ogimages" || SRCIMG="ogimages/$2" eval $(grep "OPTIONS=" /scripts/ogfunctions) -# Opciones de montaje: lectura o escritura -mount |grep "ogimages.*rw," &>/dev/null && RW=",rw" || RW=",ro" - ogEcho session log "$MSG_HELP_ogChangeRepo $NEWREPO ${2%/}" ogConnect $NEWREPO $ogprotocol $SRCIMG $OGIMG $RW diff --git a/client/engine/PostConf.lib b/client/engine/PostConf.lib index 1f04532f..4e07f5a0 100755 --- a/client/engine/PostConf.lib +++ b/client/engine/PostConf.lib @@ -22,7 +22,8 @@ #@return (nada) #@date 2014-10-27 #*/ ## -function ogCleanOs { +function ogCleanOs () +{ # Si se solicita, mostrar ayuda. if [ "$*" == "help" ]; then @@ -38,7 +39,7 @@ case "$(ogGetOsType $1 $2)" in Linux) # Borramos los ficheros de dispositivos y los temporales. ogCleanLinuxDevices $1 $2 - rm -rf $(ogMount $1 $2)/tmp/* + rm -rf $(ogMount $1 $2)/tmp/* #*/ Comentario Doxygen ;; Windows) # Borrar ficheros de hibernación y paginación de Windows. @@ -314,6 +315,10 @@ Set objComputer = GetObject("winmgmts:{impersonationLevel=Impersonate}!\\\" & _ ReturnValue = objComputer.JoinDomainOrWorkGroup(strDomain, strPassword, _ strDomain & "\" & strUser, NULL, JOIN_DOMAIN + ACCT_CREATE) EOF + +#*/ " (comentario Doxygen) + + } diff --git a/client/engine/Protocol.lib b/client/engine/Protocol.lib index 786dba87..279961a5 100755 --- a/client/engine/Protocol.lib +++ b/client/engine/Protocol.lib @@ -337,13 +337,16 @@ fi #@version 1.1 - Control de errores en transferencia multicast (ticket #781) #@author Irina Gomez, ETSII Universidad de Sevilla #@date 2017/04/20 +#@version 1.1.0.a - Parametros de clientes como sesision de multicast (ticket #851) +#@author Antonio J. Doblas Viso +#@date 2018/09/22 #*/ ## # function ogMcastSyntax () { -local ISUDPCAST RECEIVERTIMEOUT PARM SESSION SESSIONPARM MODE PORTBASE PERROR +local ISUDPCAST RECEIVERTIMEOUT STARTTIMEOUT PARM SESSION SESSIONPARM MODE PORTBASE PERROR local METHOD ADDRESS BITRATE NCLIENTS MAXTIME CERROR local TOOL LEVEL DEVICE MBUFFER SYNTAXSERVER SYNTAXCLIENT @@ -356,45 +359,48 @@ if [ "$*" == "help" -o "$2" == "help" ]; then "sessionServer syntax: portbase:method:mcastaddress:speed:nclients:ntimeWaitingUntilNclients " \ "sessionServer example: 9000:full-duplex|half-duplex|broadcast:239.194.17.36:80M:50:60 " \ "sessionClient syntax: portbase " \ - "sessionClient example: 9000 " + "sessionClient example: 9000 "\ + "sessionClient syntax: portbase:serverIP:TimeOut_session:TimeOut_transmision" \ + "sessionClient example: 9000:172.17.88.161:40:120" return fi PERROR=0 #si no tenemos updcast o su version superior 2009 udpcast error. ISUDPCAST=$(udp-receiver --help 2>&1) -echo $ISUDPCAST | grep start-timeout > /dev/null || ogRaiseError $OG_ERR_NOTEXEC "upd-cast no existe o version antigua -requerida 2009-"|| return $? +echo $ISUDPCAST | grep "not found" > /dev/null && (ogRaiseError $OG_ERR_NOTEXEC "upd-cast no existe " || return $?) -# Si la version de udp-receiver permite --receive-timeout utilizamos la opción -if echo $ISUDPCAST | grep receive-timeout &>/dev/null; then - RECEIVERTIMEOUT=" --receive-timeout $MCASTWAIT" -else - RECEIVERTIMEOUT="" -fi - -# Error si no se reciben $PARM parámetros. +############ BEGIN NUMBERS PARAMETERS CHECK AND SESSION OPTIONS IF CLIENT OR SERVER ############## +# Definimos los parametros de la funcion segun la opcion de envio/recepcion. echo "$1" | grep "PARTITION" > /dev/null && PARM=5 || PARM=3 [ "$#" -eq "$PARM" ] || ogRaiseError $OG_ERR_FORMAT "sin parametros"|| return $? - - -# 1er param check +# 1er param check: opcion de envio/recepcion ogCheckStringInGroup "$1" "SENDPARTITION sendpartition RECEIVERPARTITION receiverpartition SENDFILE sendfile RECEIVERFILE receiverfile" || ogRaiseError $OG_ERR_FORMAT "1st param: $1" || PERROR=1 #return $? - -# 2º param check +# 1º param check : opcion de cliente/servidor echo "$1" | grep "SEND" > /dev/null && MODE=server || MODE=client -#TODO: diferenciamos los paramatros especificos de la sessión multicast -#SI: controlamos todos los parametros de la sessión multicast. +# 2º param check: sesion multicast cliente/servidor. comprobamos el numero de parametros segun el tipo de sesion cliente o servidor. +#Definimos los parametros de la sesion multicast. La sesion de cliente seran 3, aunque uno es el obligado y dos opcionales. puerto:server:autostart [ $MODE == "client" ] && SESSIONPARM=1 || SESSIONPARM=6 +#Controlamos el numero de paratros incluidos en la sesion usada como paraetro $2 OIFS=$IFS; IFS=':' ; SESSION=($2); IFS=$OIFS +#Controlamos la sesion multicast del server +if [ $MODE == "server" ] +then + [[ ${#SESSION[*]} == $SESSIONPARM ]] || ogRaiseError $OG_ERR_FORMAT "parametros session de servidor multicast no completa" || PERROR=2# return $? +fi +#controlamos la sesion de cliente. +if [ $MODE == "client" ] +then + [[ ${#SESSION[*]} -ge $SESSIONPARM ]] || ogRaiseError $OG_ERR_FORMAT "parametros session de cliente multicast no completa" || PERROR=2# return $? +fi +############ END NUMBERS PARAMETERS CHECK ############## - -[[ ${#SESSION[*]} == $SESSIONPARM ]] || ogRaiseError $OG_ERR_FORMAT "parametros session multicast no completa" || PERROR=2# return $? - - -#controlamos el PORTBASE de la sesion. Comun.- +##### BEGIN SERVER SESSION ##### +# 2º param check: controlamos el primer componente comun de las sesiones de servidor y cliente: PORTBASE PORTBASE=${SESSION[0]} ogCheckStringInGroup ${SESSION[0]} "$(seq 9000 2 9050)" || ogRaiseError $OG_ERR_FORMAT "McastSession portbase ${SESSION[0]}" || PERROR=3 #return $? +# 2º param check: Controlamos el resto de componenentes de la sesion del servidor. if [ $MODE == "server" ] then ogCheckStringInGroup ${SESSION[1]} "full-duplex FULL-DUPLEX half-duplex HALF-DUPLEX broadcast BROADCAST" || ogRaiseError $OG_ERR_FORMAT "McastSession method ${SESSION[1]}" || PERROR=4 #return $? @@ -422,69 +428,114 @@ then ogCheckStringInGroup "$5" "lzop LZOP gzip GZIP 0 1" || ogRaiseError $OG_ERR_NOTFOUND " compresor $5 no valido" || PERROR=11 #return $? LEVEL=$5 fi - - +# Controlamos si ha habido errores en la comprobacion de la sesion de servidor. if [ "$PERROR" != "0" ]; then ogRaiseError $OG_ERR_MCASTSYNTAXT " $PERROR"; return $? fi - - -# Valores estandar no configurables. +# Asignamos mas valores no configurables a la sesioe servidor. CERROR="8x8/128" - -# opción del usuo de tuberia intermedia en memoria mbuffer. +# opcion del usuo de tuberia intermedia en memoria mbuffer. which mbuffer > /dev/null && MBUFFER=" --pipe 'mbuffer -q -m 20M' " -# Generamos la instrucción base de multicast -Envio,Recepcion- +# Generamos la instruccion base del servidor de multicast -Envio- SYNTAXSERVER="udp-sender $MBUFFER --nokbd --portbase $PORTBASE --$METHOD --mcast-data-address $ADDRESS --fec $CERROR --max-bitrate $BITRATE --ttl 16 --min-clients $NCLIENTS --max-wait $MAXTIME --autostart $MAXTIME --log /tmp/mcast.log" -#SYNTAXCLIENT="udp-receiver $MBUFFER --portbase $PORTBASE " +########################################################################## +#### END SERVER SESSION ############## -# Deteccion automatica de la subred del cliente para anadir la IP del repositorio a la orden udp-receiver en el caso de encontrarse en distinta subred del repo -REPOIP="$(ogGetRepoIp)" -CLIENTIP=$(ip -o address show up | awk '$2!~/lo/ {if ($3~/inet$/) {printf ("%s ", $4)}}') -MASCARA=`echo $CLIENTIP | cut -f2 -d/` -CLIENTIP=`echo $CLIENTIP | cut -f1 -d/` -RIPBT="" -IPBT="" -for (( i = 1 ; i < 5 ; i++ )) -do - RIP=`echo $REPOIP | cut -f$i -d.` - RIP=`echo "$[$RIP + 256]"` - RIPB="" - while [ $RIP -gt 0 ] - do - let COCIENTE=$RIP/2 - let RESTO=$RIP%2 - RIPB=$RESTO$RIPB - RIP=$COCIENTE - done - RIPB=`echo "$RIPB" | cut -c2-` - RIPBT=$RIPBT$RIPB - IP=`echo $CLIENTIP | cut -f$i -d.` - IP=`echo "$[$IP + 256]"` - IPB="" - while [ $IP -gt 0 ] +##### BEGIN CLIENT SESSION ##### +#La primera opcion PORTBASE, ya esta controlado. Porque es comun al server y al cliente. +#La segunda opcion de la sesion para el cliente:: SERVERADDRES +if ogCheckIpAddress ${SESSION[1]} 2>/dev/null +then + SERVERADDRESS=" --mcast-rdv-address ${SESSION[1]}" +else + # Deteccion automatica de la subred del cliente para anadir la IP del repositorio a la orden udp-receiver en el caso de encontrarse en distinta subred del repo + REPOIP="$(ogGetRepoIp)" + CLIENTIP=$(ip -o address show up | awk '$2!~/lo/ {if ($3~/inet$/) {printf ("%s ", $4)}}') + MASCARA=`echo $CLIENTIP | cut -f2 -d/` + CLIENTIP=`echo $CLIENTIP | cut -f1 -d/` + RIPBT="" + IPBT="" + for (( i = 1 ; i < 5 ; i++ )) do - let COCIENTE=$IP/2 - let RESTO=$IP%2 - IPB=$RESTO$IPB - IP=$COCIENTE + RIP=`echo $REPOIP | cut -f$i -d.` + RIP=`echo "$[$RIP + 256]"` + RIPB="" + while [ $RIP -gt 0 ] + do + let COCIENTE=$RIP/2 + let RESTO=$RIP%2 + RIPB=$RESTO$RIPB + RIP=$COCIENTE + done + RIPB=`echo "$RIPB" | cut -c2-` + RIPBT=$RIPBT$RIPB + IP=`echo $CLIENTIP | cut -f$i -d.` + IP=`echo "$[$IP + 256]"` + IPB="" + while [ $IP -gt 0 ] + do + let COCIENTE=$IP/2 + let RESTO=$IP%2 + IPB=$RESTO$IPB + IP=$COCIENTE + done + IPB=`echo "$IPB" | cut -c2-` + IPBT=$IPBT$IPB done - IPB=`echo "$IPB" | cut -c2-` - IPBT=$IPBT$IPB -done -MCASTWAIT=${MCASTWAIT:-120} -REPOSUBRED=`echo $RIPBT | cut -c1-$MASCARA` -CLIENTSUBRED=`echo $IPBT | cut -c1-$MASCARA` -if [ $REPOSUBRED == $CLIENTSUBRED ]; then - SYNTAXCLIENT="udp-receiver $MBUFFER --portbase $PORTBASE $RECEIVERTIMEOUT --start-timeout $MCASTWAIT" -else - SYNTAXCLIENT="udp-receiver $MBUFFER --portbase $PORTBASE --mcast-rdv-address $REPOIP $RECEIVERTIMEOUT --start-timeout $MCASTWAIT" + REPOSUBRED=`echo $RIPBT | cut -c1-$MASCARA` + CLIENTSUBRED=`echo $IPBT | cut -c1-$MASCARA` + if [ $REPOSUBRED == $CLIENTSUBRED ]; then + SERVERADDRESS=" " + else + SERVERADDRESS=" --mcast-rdv-address $REPOIP" + fi +fi +#La tercera opcion de la sesion para el cliente: ${SESSION[2]} ERRORSESSION - TIMEOUT ERROR IF NO FOUNT SESSEION MULTICAST +if ogCheckStringInReg ${SESSION[2]} "^[0-9]{1,10}$" &>/dev/null +then + case ${SESSION[2]} in + 0) + STARTTIMEOUT=" " + ;; + *) + STARTTIMEOUT=" --start-timeout ${SESSION[2]}" + ;; + esac +else + #asignamos valor definido en el engine.cfg + STARTTIMEOUT=" --start-timeout $MCASTERRORSESSION" fi +#Verificamos que la opcion start-time out esta soportada por la version del cliente +echo $ISUDPCAST | grep start-timeout > /dev/null || STARTTIMEOUT=" " + +#La cuarta opcion de la sesion para el cliente: ${SESSION[2]} ERROR TRANSFER - TIMEOUT EEOR IF NOT RECEIVER DATA FROM SERVER +if ogCheckStringInReg ${SESSION[3]} "^[0-9]{1,10}$" &>/dev/null +then + case ${SESSION[3]} in + 0) + RECEIVERTIMEOUT=" " + ;; + *) + RECEIVERTIMEOUT=" --receive-timeout ${SESSION[3]}" + ;; + esac +else + #asignamos valor definido en el engine.cfg + RECEIVERTIMEOUT=" --receive-timeout $MCASTWAIT" +fi +#Verificamos que la opcion receive-timeou esta soportada por la version del cliente +echo $ISUDPCAST | grep receive-timeout > /dev/null || RECEIVERTIMEOUT=" " + +#Componenemos la sesion multicast del cliente +SYNTAXCLIENT="udp-receiver $MBUFFER --portbase $PORTBASE $SERVERADDRESS $STARTTIMEOUT $RECEIVERTIMEOUT --log /tmp/mcast.log" +########################################################################## +#### END CLIENT SESSION ############## + ######## BEGIN MAIN PROGAM ##### case "$1" in -SENDPARTITION) + SENDPARTITION) PROG1=`ogCreateImageSyntax $DEVICE " " $TOOL $LEVEL | awk -F"|" '{print $1 "|" $3}' | tr -d ">"` echo "$PROG1 | $SYNTAXSERVER" ;; @@ -502,6 +553,7 @@ SENDPARTITION) *) ;; esac +######## END MAIN PROGAM ##### } @@ -781,7 +833,8 @@ fi #@author Irina Gomez, ETSII Universidad de Sevilla #@date 2017/06/23 #*/ ## -function ogMcastRequest { +function ogMcastRequest () +{ # Variables locales local FILE PROTOOPT PORT PORTAUX REPOIP REPOPORTAUX REPEAT OGUNIT @@ -828,9 +881,8 @@ done #@param (2 parámetros) $1 path_aboluto_fichero_torrent $2 Parametros_Session_Torrent #@param (3 parámetros) $1 Contenedor CACHE $2 path_absoluto_fichero_Torrent $3 Parametros_Session_Torrent #@param (4 parámetros) $1 disk $2 particion $3 path_absoluto_fichero_Torrent 4$ Parametros_Session_Torrent - #@return -#@note +#@note protocoloTORRENT=mode:time mode=seeder -> Dejar el equipo seedeando hasta que transcurra el tiempo indicado o un kill desde consola, mode=peer -> seedear mientras descarga mode=leecher -> NO seedear mientras descarga time tiempo que una vez descargada la imagen queremos dejar al cliente como seeder. #@todo: #@version 0.1 - Integración para OpenGNSys. #@author Antonio J. Doblas Viso. Universidad de Málaga @@ -845,13 +897,6 @@ done #@author Antonio J. Doblas Viso. Univesidad de Málaga. #@date #*/ ## - -#protocoloTORRENT mode:time -#mode=seeder -> Dejar el equipo seedeando hasta que transcurra el tiempo indicado o un kill desde consola, -#mode=peer -> seedear mientras descarga -#mode=leecher -> NO seedear mientras descarga -#time tiempo que una vez descargada la imagen queremos dejar al cliente como seeder. - function ogTorrentStart () { diff --git a/client/engine/Rsync.lib b/client/engine/Rsync.lib index d123232a..a68ea382 100755 --- a/client/engine/Rsync.lib +++ b/client/engine/Rsync.lib @@ -318,7 +318,7 @@ IMGLN="ogimg.ln" IMGINFO="ogimg.info" # Copiamos informacion de la imagen a /tmp (para basicas) -[ -r $DEST/$IMGACL ] && cp $DEST/ogimg.* /tmp +[ -r $DEST/$IMGINFO ] && cp $DEST/ogimg.* /tmp #Creamos o modificamos los enlaces. # La imagen diferencial tiene ogimg.ln @@ -384,7 +384,6 @@ fi } -function ogSyncCreate () { #/** # ogSyncCreate #@brief sincroniza los datos de la partición a la imagen para crearla. La imagen esta montada en un directorio. @@ -394,6 +393,7 @@ function ogSyncCreate () { #@param 4 Nombre Imagen #@param 5 Tipo imagen [ img | diff ] #*/ +function ogSyncCreate () { local ORIG DIRAUX DIRMOUNT DESTRSYNC USERRSYNC PASSWORD OPTRSYNC RETVAL # Limpiamos los archivo de log @@ -525,7 +525,7 @@ echo " rsync -aHAX$OPTRSYNC --progress $FILESFROM $ORIG/ $DESTRSYNC" rsync -aHAX$OPTRSYNC $PASSWORD --progress $FILESFROM "$ORIG/" "$DESTRSYNC" 2>$OGLOGCOMMAND | egrep "^deleting|^sent|^sending|^total|%" |tee -a $OGLOGCOMMAND RETVAL=${PIPESTATUS[0]} cd / -return $RETVAL +#*/ " Comentario Doxygen } diff --git a/client/engine/String.lib b/client/engine/String.lib index 3c4430e6..5774fe7a 100755 --- a/client/engine/String.lib +++ b/client/engine/String.lib @@ -14,7 +14,7 @@ #@author Antonio Doblas Viso, Universidad de Málaga #@date 2010/05/09 #*/ ## -#/** + function ogCheckStringInGroup () { local i @@ -54,8 +54,6 @@ return 1 #@author Antonio Doblas Viso, Universidad de Málaga #@date 2010/05/09 #*/ ## -#/** - function ogCheckStringInReg() { @@ -91,7 +89,7 @@ REG=$2 #@author Antonio Doblas Viso, Universidad de Málaga #@date 2010/05/09 #*/ ## -#/** + function ogCheckIpAddress() { local REG IP arrIP diff --git a/client/shared/bin/poweroffconf b/client/shared/bin/poweroffconf index 02038605..de6726b4 100755 --- a/client/shared/bin/poweroffconf +++ b/client/shared/bin/poweroffconf @@ -2,6 +2,7 @@ #/** #@file poweroffconf #@brief Control de parada tras tiempo de inactividad para ahorro de energía. +#@license GNU GPLv3+ #@param int_minutos Minutos de inactividad (opcional); "no" para deshabilitar.. #@note La comprobación periódica debe ejecutarse en el "cron" del sistema. #@note Fichero de configuración: /etc/poweroff.conf @@ -10,7 +11,9 @@ #@version 1.0.5: incluir opción para deshabilitar ahorro de energía. #@author Ramón Gómez - Univ. Sevilla #@date 2014-02-07 -#@warning License: GNU GPLv3+ +#@version 1.1.1: Corregir problema al cambiar de día +#@author Ramón Gómez - Univ. Sevilla +#@date 2018-07-04 #*/ @@ -49,7 +52,7 @@ case $# in # Si se necesita, recalcular tiempo de parada. if [ -n "POWEROFFTIME" ]; then # Asignar tiempo de apagado si no está deshabilitado y actualizar fichero. - POWEROFFTIME=${POWEROFFSLEEP:+$(date --date="$POWEROFFSLEEP min" +"%H%M")} + POWEROFFTIME=${POWEROFFSLEEP:+$(date --date="$POWEROFFSLEEP min" +"%s")} perl -pi -e "s/POWEROFFTIME=.*/POWEROFFTIME=$POWEROFFTIME/" $POWEROFFCONF fi exit 0 ;; @@ -64,10 +67,10 @@ if [ -n "$($PGREP $OPENGNSYS | egrep -v "$OGETC|$0")" ]; then perl -pi -e 's/POWEROFFTIME=.*$/POWEROFFTIME=/' $POWEROFFCONF else # Si el sistema está en estado de espera, ... - NOW=$(date +"%H%M") + NOW=$(date +"%s") if [ -z "$POWEROFFTIME" ]; then # Asignar tiempo de inicio, si no estaba definido. - POWEROFFTIME=$(date --date="$POWEROFFSLEEP min" +"%H%M") + POWEROFFTIME=$(date --date="$POWEROFFSLEEP min" +"%s") perl -pi -e "s/POWEROFFTIME=.*$/POWEROFFTIME=$POWEROFFTIME/" $POWEROFFCONF else # Apagar el equipo si se sobrepasa el periodo de espera. diff --git a/client/shared/etc/engine.cfg b/client/shared/etc/engine.cfg index 7bb74d48..279acd50 100644 --- a/client/shared/etc/engine.cfg +++ b/client/shared/etc/engine.cfg @@ -12,7 +12,7 @@ OGWINCHKDISK=TRUE #Que hacer cuando la cache no tenga espacio libre. [ NONE | FORMAT ] ] ACTIONCACHEFULL=NONE #Que protocolo de restauracion usar en el caso de que no exista cache o no exista espacio sufiente. [NONE | UNICAST | MULTICAST].NONE retorna error -RESTOREPROTOCOLNOTCACHE=UNICAST +RESTOREPROTOCOLNOTCACHE=NONE #script Creacion imagen IMGPROG="partclone" @@ -24,7 +24,10 @@ IMGREDUCE="TRUE" #Al enviar particion reducir el sistema de archivos previamente. OGWINREDUCE=TRUE -# MULTICAST: timeout si la transferencia no comienza o se interrumpe. +# Sesion MULTICAST de cliente +#timeout (segundos) para abortar la sesion de multicast si no contacta con el servidor de multicast. Valor asignado a 0, utiliza los valores por defecto de udp-cast +MCASTERRORSESSION=120 +# timeout (segundos) para abortar la la transferencia si se interrumpe. Valor asignado a 0, utiliza los valores por defecto de udp-cast MCASTWAIT=30 # Imagenes sincronizadas diff --git a/client/shared/etc/engine.json b/client/shared/etc/engine.json index 909a82f7..ef34de5e 100644 --- a/client/shared/etc/engine.json +++ b/client/shared/etc/engine.json @@ -65,8 +65,13 @@ "name": "RESTOREPROTOCOLNOTCACHE", "value": "UNICAST" }, + { + "description": "timout if Multicast transfer does not begins (seconds)", + "name": "MCASTERRORSESSION", + "value": 120 + }, { - "description": "timout if Multicast transfer does not begins or it's interrupted (seconds)", + "description": "timout if Multicast transfer does it's interrupted (seconds)", "name": "MCASTWAIT", "value": 30 }, diff --git a/client/shared/scripts/cloneRemoteFromMaster b/client/shared/scripts/cloneRemoteFromMaster index 9aedefde..b78bd629 100755 --- a/client/shared/scripts/cloneRemoteFromMaster +++ b/client/shared/scripts/cloneRemoteFromMaster @@ -57,6 +57,10 @@ #@version 1.0.6 - Uso de la funcion ogExecuteAndLog #@author Antonio J. Doblas Viso. Universidad de Malaga. #@date 2012/02/12 +#@version 1.1.0.a - sesion multicast cliente puerto:master:0:0 (ticket #872) +#@author Antonio J. Doblas Viso +#@date 2018/09/11 +#*/ ## #*/ ## #test 1. cliente sin particiones. Detectado TODO: crear estrucutras de particiones @@ -106,7 +110,7 @@ PROTOCOL="$4" case "${PROTOCOL^^}" in MULTICAST) SESSIONMCASTSERVER=$5 - SESSIONMCASTCLIENT=`echo $5 | awk -F: '{print $1}'` + SESSIONMCASTCLIENT=`echo $5 | awk -F: '{print $1}'`:$MASTERIP:0:0 ;; UNICAST) SESSIONUCASTSERVER=$5 diff --git a/client/shared/scripts/configureOs b/client/shared/scripts/configureOs index a19bf4ed..4b7ec6f7 100755 --- a/client/shared/scripts/configureOs +++ b/client/shared/scripts/configureOs @@ -73,13 +73,13 @@ case "$OSTYPE" in ogWindowsBootParameters $1 $2 # Registrar en Windows que la partición indicada es su nueva unidad C:\ ogWindowsRegisterPartition $1 $2 C $1 $2 + # Configurar nuevo agente OGAgent. + ogConfigureOgagent $1 $2 # Eliminar el antiguo cliente de Windows. if [ -n "$(ogGetPath $MNTDIR/windows/ogAdmWinClient.exe)$(ogGetPath $MNTDIR/winnt/ogAdmWinClient.exe)" ]; then ogInstallMiniSetup $1 $2 postconf.cmd ogUninstallWindowsClient $1 $2 postconf.cmd fi - # Configurar nuevo agente OGAgent. - ogConfigureOgagent $1 $2 ;; Linux) # Postconfiguración de GNU/Linux. ## Instala (no configura) el codigo de arranque del Grub en la partición (no lo configura, se mantiene el original de la imagen) diff --git a/client/shared/scripts/createBaseImage b/client/shared/scripts/createBaseImage index c367e930..f7ef2a58 100755 --- a/client/shared/scripts/createBaseImage +++ b/client/shared/scripts/createBaseImage @@ -6,7 +6,7 @@ #@brief Se usa como base para el programa de creación de imágenes de OpenGnsys Admin). #@param 1 disco #@param 2 particion -#@param 3 REPO|CACHE +#@param 3 REPO|CACHE|IPREPO #@param 4 imagen #@return #@exception OG_ERR_FORMAT # 1 formato incorrecto. @@ -25,15 +25,18 @@ #@version 1.1.0 - Se muestra el espacio necesario para alojar la imagen y el disponible (ticket #771) #@author Irina Gomez - ETSII Universidad de Sevilla #@date 2017-03-28 +#@version 1.1.1 - Varios repositorios para un mismo cliente (ticket #679). +#@author Irina Gomez - ETSII Universidad de Sevilla +#@date 2018/11/06 #*/ ## -trap "onexit $1 $2 $3 \"$4\"" 1 2 3 6 9 14 15 EXIT +trap "onexit $1 $2 $IMGFILE" 1 2 3 6 9 14 15 EXIT # Si salimos con error demontamos la imagen y desbloqueamos la imagen y la particion function onexit() { local exit_status=$? if [ $exit_status -ne 4 ]; then - ogUnlockImage "$3" "/$4.$IMGEXT" + ogUnlockImage "$IMGFILE" ogUnlock $1 $2 fi exit $exit_status @@ -62,15 +65,26 @@ ogEcho log session "[1] $MSG_SCRIPTS_START $0 $*" # Valores por defecto en etc/engine.cfg IMGEXT=${IMGEXT:-"img"} -REPOIP=$(ogGetRepoIp) - +REPO="${3^^}" +# No permite directorios diferentes para OU +OGUNIT="" + +# Si es una ip y es igual a la del equipo restaura desde cache +[ "$REPO" == "$(ogGetIpAddress)" ] && REPO="CACHE" +# Si es una ip y es distinta a la del recurso samba cambiamos de REPO. +ogCheckIpAddress $REPO +if [ $? == 0 -o $REPO == "REPO" ] ; then + # Si falla el cambio -> salimos con error repositorio no valido + ogChangeRepo $REPO $OGUNIT || exit $(ogRaiseError $OG_ERR_NOTFOUND '$REPO'; echo $?) + REPO="REPO" +fi # Comprobamos si la imagen o la particion estan bloqueada: -ogIsImageLocked "$3" "$4.$IMGEXT" && exit $(ogRaiseError session $OG_ERR_LOCKED "$3 $4.$IMGEXT"; echo $?) +ogIsImageLocked "$REPO" "$4.$IMGEXT" && exit $(ogRaiseError session $OG_ERR_LOCKED "$REPO $4.$IMGEXT"; echo $?) ogIsLocked "$1" "$2" && exit $(ogRaiseError session $OG_ERR_LOCKED "$1 $2"; echo $?) # Si el repositorio es CACHE comprobamos que exista -if [ "$3" == "CACHE" -o "$3" == "cache" ]; then +if [ "$REPO" == "CACHE" -o "$REPO" == "cache" ]; then ! ogFindCache >/dev/null && exit $(ogRaiseError session $OG_ERR_NOTCACHE "CACHE "; echo $?) fi @@ -90,25 +104,25 @@ ORIG=$(ogMount $1 $2) || exit $(ogRaiseError session $OG_ERR_PARTITION "$1 $2" ; ogCleanOs $1 $2 #Comprobar espacio que requerira la imagen para ser almacenada -read SIZEDATA SIZEREQUIRED SIZEFREE ISENOUGHSPACE <<< $(ogGetSizeParameters $1 $2 "$3" "$4" SYNC) +read SIZEDATA SIZEREQUIRED SIZEFREE ISENOUGHSPACE <<< $(ogGetSizeParameters $1 $2 "$REPO" "$4" SYNC) ogEcho log session "[16] $PROG: $MSG_SCRIPTS_CREATE_SIZE $SIZEREQUIRED $SIZEFREE" -[ "$ISENOUGHSPACE" == "TRUE" ] || exit $(ogRaiseError session $OG_ERR_CACHESIZE "$3"; echo $?) +[ "$ISENOUGHSPACE" == "TRUE" ] || exit $(ogRaiseError session $OG_ERR_CACHESIZE "$REPO"; echo $?) -IMGDIR="$(ogGetParentPath "$3" "/$4")" -IMGFILE=${IMGDIR[$3]}/$(basename "/$4").$IMGEXT +IMGDIR="$(ogGetParentPath "$REPO" "/$4")" +IMGFILE=${IMGDIR}/$(basename "/$4").$IMGEXT # Crear la imagen. echo " " > $OGLOGCOMMAND TIME2=$SECONDS -ogEcho log session "[40] $MSG_HELP_ogCreateImage $1 $2 $3 $4 " +ogEcho log session "[40] $MSG_HELP_ogCreateImage $1 $2 $REPO $4 " # Si existe el fichero de la imagen se hace copia de seguridad y se redimensiona, si no existe se crea. # Bloqueo la imagen. Si esta en modo lectura dara error y nos salimos ogEcho log session "[50] $MSG_HELP_ogCreateFileImage." -ogLockImage "$3" "/$4.$IMGEXT" || exit $? -ogCreateFileImage $3 "$4" $IMGEXT $SIZEREQUIRED +ogLockImage "$REPO" "/$4.$IMGEXT" || exit $? +ogCreateFileImage $REPO "$4" $IMGEXT $SIZEREQUIRED # Creamos la lista del contenido y lo situamos en la particion a copiar. ogEcho log session "[60] $MSG_HELP_ogCreateInfoImage" @@ -118,11 +132,11 @@ TIMEAUX3=$[SECONDS-TIME2] ogEcho log session " $MSG_SCRIPTS_TASK_END, $MSG_SCRIPTS_TIME_PARTIAL : $[TIMEAUX3/60]m $[TIMEAUX3%60]s" # Esperamos que el servidor termine de crear y montar la imagen -ogWaitSyncImage "$3" "$4" $IMGEXT "mounted" $SIZEREQUIRED || exit $(ogRaiseError session $OG_ERR_DONTMOUNT_IMAGE "$3 $4 $IMGEXT: time_out."; echo $?) +ogWaitSyncImage "$REPO" "$4" $IMGEXT "mounted" $SIZEREQUIRED || exit $(ogRaiseError session $OG_ERR_DONTMOUNT_IMAGE "$REPO $4 $IMGEXT: time_out."; echo $?) # Sincronizamos los datos de la particion con la imagen. ogEcho log session "[70] $MSG_HELP_ogSyncCreate." -ogSyncCreate $1 $2 $3 "$4" $IMGEXT +ogSyncCreate $1 $2 $REPO "$4" $IMGEXT RETVAL=$? [ $RETVAL == 0 ] || ogEcho session warning "$MSG_ERR_SYNCHRONIZING" @@ -130,16 +144,16 @@ TIMEAUX5=$[SECONDS-TIMEAUX3] ogEcho log session " $MSG_SCRIPTS_TASK_END, $MSG_SCRIPTS_TIME_PARTIAL: $[TIMEAUX5/60]m $[TIMEAUX5%60]s" # Reducimos la imagen: solo para kernel <= 3.7, imagenes con FS ext4. (Desmonta y desbloquea la imagen) -ogEcho log session "[80] $MSG_HELP_ogReduceImage: $3 /$4.$IMGEXT" -ogReduceImage $3 "$4" $IMGEXT +ogEcho log session "[80] $MSG_HELP_ogReduceImage: $REPO /$4.$IMGEXT" +ogReduceImage $REPO "$4" $IMGEXT # Esperamos que el servidor termine de reducir la imagen -ogWaitSyncImage "$3" "$4" $IMGEXT "reduced" $SIZEREQUIRED || exit $(ogRaiseError session $OG_ERR_DONTMOUNT_IMAGE "$3 $4 $IMGEXT: time_out."; echo $?) +ogWaitSyncImage "$REPO" "$4" $IMGEXT "reduced" $SIZEREQUIRED || exit $(ogRaiseError session $OG_ERR_DONTMOUNT_IMAGE "$REPO $4 $IMGEXT: time_out."; echo $?) echo " " > $OGLOGCOMMAND sleep 2 # Comprobamos que la imagen esta bien detectacdo que es un sistema de ficheros. ogEcho log session "[95] $MSG_HELP_ogCheckSyncImage" -ogCheckSyncImage $3 "$4" "img" || exit $(ogRaiseError session $OG_ERR_IMAGE "$3 $4 img" ; echo $?) +ogCheckSyncImage $REPO "$4" "img" || exit $(ogRaiseError session $OG_ERR_IMAGE "$REPO $4 img" ; echo $?) #resumen de la operacion IMGSIZE=$(ls -l --block-size=1024 "$IMGFILE" | cut -f5 -d" ") diff --git a/client/shared/scripts/createDiffImage b/client/shared/scripts/createDiffImage index 79ee9726..ddee5c7b 100755 --- a/client/shared/scripts/createDiffImage +++ b/client/shared/scripts/createDiffImage @@ -28,16 +28,19 @@ #@version 1.1.0 - Se muestra el espacio necesario para alojar la imagen y el disponible (ticket #771) #@author Irina Gomez - ETSII Universidad de Sevilla #@date 2017-03-28 +#@version 1.1.1 - Varios repositorios para un mismo cliente (ticket #679). +#@author Irina Gomez - ETSII Universidad de Sevilla +#@date 2018/11/06 #*/ ## -trap "onexit $1 $2 $3 \"$4\" \"$5\"" 1 2 3 6 9 14 15 EXIT +trap "onexit $1 $2 \"$4\" \"$5\"" 1 2 3 6 9 14 15 EXIT function onexit() { local exit_status=$? - ogUnmountImage $3 "$5" $DIFFTYPE &>/dev/null - ogUnmountImage $3 "$4" $IMGEXT &>/dev/null + ogUnmountImage $REPO "$5" $DIFFTYPE &>/dev/null + ogUnmountImage $REPO "$3" $IMGEXT &>/dev/null if [ $exit_status -ne 4 ]; then - ogUnlockImage "$3" "/$4.$IMGEXT" &>/dev/null - ogUnlockImage "$3" "/$5.$DIFFEXT" &>/dev/null + ogUnlockImage "$IMGFILE" &>/dev/null + ogUnlockImage "$DIFFFILE" &>/dev/null ogUnlock $1 $2 &>/dev/null fi exit $exit_status @@ -59,33 +62,45 @@ fi [ $# -lt 5 ] && exit $(ogRaiseError session $OG_ERR_FORMAT "$MSG_FORMAT: $PROG ndisco nparticion REPO|CACHE base_image diff_image"; echo $?) -# Valores por defecto en etc/engine.cfg -IMGEXT="img" -DIFFEXT="img.diff" -DIFFTYPE="diff" -REPOIP=$(ogGetRepoIp) - # Limpiamos los archivo de log echo -n "" >$OGLOGCOMMAND [ "$(ogGetCaller)" == "RestaurarSoftIncremental" ] || echo -n "" > $OGLOGSESSION ogEcho log session "[1] $MSG_SCRIPTS_START $0 $*" +# Valores por defecto en etc/engine.cfg +IMGEXT="img" +DIFFEXT="img.diff" +DIFFTYPE="diff" +REPO="${3^^}" +# No permite directorios diferentes para OU +OGUNIT="" + +# Si es una ip y es igual a la del equipo restaura desde cache +[ "$REPO" == "$(ogGetIpAddress)" ] && REPO="CACHE" +# Si es una ip y es distinta a la del recurso samba cambiamos de REPO. +ogCheckIpAddress $REPO +if [ $? == 0 -o $REPO == "REPO" ] ; then + # Si falla el cambio -> salimos con error repositorio no valido + ogChangeRepo $REPO $OGUNIT || exit $(ogRaiseError $OG_ERR_NOTFOUND '$REPO'; echo $?) + REPO="REPO" +fi + # Comprobamos si la imagen diferencial o la particion estan bloqueada: -ogIsImageLocked "$3" "$5.$DIFFEXT" && exit $(ogRaiseError session $OG_ERR_LOCKED "$3 $5.$DIFFEXT"; echo $?) +ogIsImageLocked "$REPO" "$5.$DIFFEXT" && exit $(ogRaiseError session $OG_ERR_LOCKED "$REPO $5.$DIFFEXT"; echo $?) ogIsLocked "$1" "$2" && exit $(ogRaiseError session $OG_ERR_LOCKED "$1 $2"; echo $?) # Comprobar si la imagen completa existe. -IMGFILE="$(ogGetPath "$3" "$4.$IMGEXT")" -[ -n "$IMGFILE" ] || exit $(ogRaiseError session $OG_ERR_NOTFOUND "$3 $4.$IMGEXT"; echo $?) +IMGFILE="$(ogGetPath "$REPO" "$4.$IMGEXT")" +[ -n "$IMGFILE" ] || exit $(ogRaiseError session $OG_ERR_NOTFOUND "$REPO $4.$IMGEXT"; echo $?) # Comprobar que la imagen completa es sincronizable -ogIsSyncImage "$3" "$4" "img" || exit $(ogRaiseError session $OG_ERR_DONTSYNC_IMAGE "$3 $4"; echo $?) +ogIsSyncImage "$REPO" "$4" "img" || exit $(ogRaiseError session $OG_ERR_DONTSYNC_IMAGE "$REPO $4"; echo $?) # Comprobar que no está bloqueada -ogIsImageLocked "$3" "$4.$IMGEXT" && exit $(ogRaiseError session $OG_ERR_LOCKED "$3 $4.$IMGEXT"; echo $?) +ogIsImageLocked "$REPO" "$4.$IMGEXT" && exit $(ogRaiseError session $OG_ERR_LOCKED "$REPO $4.$IMGEXT"; echo $?) # Si el repositorio es CACHE comprobamos que exista -if [ "$3" == "CACHE" -o "$3" == "cache" ]; then +if [ "$REPO" == "CACHE" -o "$REPO" == "cache" ]; then ! ogFindCache >/dev/null && exit $(ogRaiseError session $OG_ERR_NOTCACHE "CACHE "; echo $?) fi @@ -96,12 +111,12 @@ PART=$(ogDiskToDev "$1" "$2" 2>/dev/null) || exit $(ogRaiseError session $OG_ERR #Comprobamos que la partición se puede montar. ORIG=$(ogMount $1 $2) || exit $(ogRaiseError session $OG_ERR_PARTITION "$1 $2"; echo $?) -DIFFDIR="$(ogGetParentPath "$3" "/$5")" +DIFFDIR="$(ogGetParentPath "$REPO" "/$5")" DIFFFILE="$DIFFDIR/$5.$DIFFEXT" # Bloqueo las imagenes -> Si no hay acceso de escritura dara error y nos saldremos. -ogLockImage "$3" "/$4.$IMGEXT" || exit $? -ogLockImage "$3" "/$5.$DIFFEXT" || exit $? +ogLockImage "$REPO" "/$4.$IMGEXT" || exit $? +ogLockImage "$REPO" "/$5.$DIFFEXT" || exit $? # Comprobar consistencia del sistema de archivos. echo " " > $OGLOGCOMMAND @@ -116,25 +131,25 @@ ogCleanOs $1 $2 # Crear la imagen. echo " " > $OGLOGCOMMAND TIME2=$SECONDS -ogEcho log session "[40] $MSG_HELP_createDiffImage: $1 $2 $3 $4" +ogEcho log session "[40] $MSG_HELP_createDiffImage: $1 $2 $REPO $4" # Creamos la lista del contenido y lo situamos en la particion a copiar. # Montamos imagen completa (con la que vamos a comparar) -ogMountImage $3 "$4" $IMGEXT >/dev/null +ogMountImage $REPO "$4" $IMGEXT >/dev/null # Comprobar que la imagen completa se ha montado -ogWaitSyncImage $3 "$4" $IMGEXT "mounted" || exit $(ogRaiseError session $OG_ERR_DONTMOUNT_IMAGE "$3 $4 $IMGEXT: time_out."; echo $?) +ogWaitSyncImage $REPO "$4" $IMGEXT "mounted" || exit $(ogRaiseError session $OG_ERR_DONTMOUNT_IMAGE "$REPO $4 $IMGEXT: time_out."; echo $?) # Creamos la informacion de la imagen. ogEcho log session "[45] $MSG_HELP_ogCreateInfoImage " -ogCreateInfoImage $1 $2 $3 "$4" "${DIFFTYPE}" +ogCreateInfoImage $1 $2 $REPO "$4" "${DIFFTYPE}" [ $? -eq $OG_ERR_NOTDIFFERENT ] && exit $(ogRaiseError session $OG_ERR_NOTDIFFERENT; echo $?) #Comprobar espacio que requerira la imagen para ser almacenada -read SIZEDATA SIZEREQUIRED SIZEFREE ISENOUGHSPACE <<< $(ogGetSizeParameters $1 $2 "$3" "$5" DIFF) +read SIZEDATA SIZEREQUIRED SIZEFREE ISENOUGHSPACE <<< $(ogGetSizeParameters $1 $2 "$REPO" "$5" DIFF) ogEcho log session "[50] $PROG: $MSG_SCRIPTS_CREATE_SIZE $SIZEREQUIRED $SIZEFREE" -[ "$ISENOUGHSPACE" == "TRUE" ] || exit $(ogRaiseError session $OG_ERR_CACHESIZE "$3"; echo $?) +[ "$ISENOUGHSPACE" == "TRUE" ] || exit $(ogRaiseError session $OG_ERR_CACHESIZE "$REPO"; echo $?) #Calculamos el tamaño de la imagen: ogMount $1 $2 >/dev/null @@ -150,31 +165,31 @@ sed -i s/SIZEDATA/"$SIZEDATA"/g /tmp/ogimg.info # Creamos o redimensionamos la imagen ogEcho log session "[60] $MSG_HELP_ogCreateFileImage." -ogCreateFileImage $3 "$5" $DIFFTYPE $SIZEREQUIRED +ogCreateFileImage $REPO "$5" $DIFFTYPE $SIZEREQUIRED # Esperamos que se monte la imagen despues de crarla en el servidor -ogWaitSyncImage "$3" "$5" "$DIFFTYPE" "mounted" $SIZEREQUIRED || exit $(ogRaiseError session $OG_ERR_DONTMOUNT_IMAGE "$3 $5 $DIFFTYPE: time_out."; echo $?) +ogWaitSyncImage "$REPO" "$5" "$DIFFTYPE" "mounted" $SIZEREQUIRED || exit $(ogRaiseError session $OG_ERR_DONTMOUNT_IMAGE "$REPO $5 $DIFFTYPE: time_out."; echo $?) ogEcho log session "[70] $MSG_HELP_ogSyncCreate" # Copio los datos a la imagen diferecial : -ogSyncCreate $1 $2 $3 "$5" $DIFFTYPE +ogSyncCreate $1 $2 $REPO "$5" $DIFFTYPE RETVAL=$? [ $RETVAL == 0 ] || ogEcho session warning "$MSG_ERR_SYNCHRONIZING" TIMEAUX6=$[SECONDS-TIMEAUX5] ogEcho log session " $MSG_SCRIPTS_TASK_END, $MSG_SCRIPTS_TIME_PARTIAL: $[TIMEAUX6/60]m $[TIMEAUX6%60]s" # Reducimos la imagen diferencial -> solo para kernel <= 3.7, imagenes con FS ext4 -ogEcho log session "[80] $MSG_HELP_ogReduceImage: $3 /$4.$IMGEXT" -ogReduceImage $3 "$5" $DIFFTYPE +ogEcho log session "[80] $MSG_HELP_ogReduceImage: $REPO /$4.$IMGEXT" +ogReduceImage $REPO "$5" $DIFFTYPE # Esperamos que el servidor termine de reducir la imagen -ogWaitSyncImage "$3" "$5" $DIFFTYPE "reduced" $SIZEREQUIRED || exit $(ogRaiseError session $OG_ERR_DONTMOUNT_IMAGE "$3 $4 $IMGEXT: time_out."; echo $?) +ogWaitSyncImage "$REPO" "$5" $DIFFTYPE "reduced" $SIZEREQUIRED || exit $(ogRaiseError session $OG_ERR_DONTMOUNT_IMAGE "$REPO $4 $IMGEXT: time_out."; echo $?) # TODO: necesaria funcion que espere a que se reduzca la imagen para continuar el script echo " " > $OGLOGCOMMAND sleep 2 # Comprobamos que la imagen esta bien ogEcho log session "[95] $MSG_HELP_ogCheckSyncImage" -ogCheckSyncImage $3 "$5" diff || exit $(ogRaiseError session $OG_ERR_IMAGE "$3 $5 diff"; echo $?) +ogCheckSyncImage $REPO "$5" diff || exit $(ogRaiseError session $OG_ERR_IMAGE "$REPO $5 diff"; echo $?) #resumen de la operacion IMGSIZE=$(ls -l --block-size=1024 "${DIFFFILE}"| cut -f5 -d" ") diff --git a/client/shared/scripts/launchOgagentInstaller b/client/shared/scripts/launchOgagentInstaller index 58d63dde..85f507b0 100755 --- a/client/shared/scripts/launchOgagentInstaller +++ b/client/shared/scripts/launchOgagentInstaller @@ -13,7 +13,7 @@ # Global variables. PROG="$(basename "$0")" if which curl &>/dev/null; then - DOWNLOAD="curl -k --timeout 1 -o" + DOWNLOAD="curl -k -f --connect-timeout 1 -o" else DOWNLOAD="wget --no-check-certificate -T 1 -O" fi @@ -41,11 +41,10 @@ case "$(ogGetOsType $1 $2)" in # Downloading OGAgent installer for Windows. OGAGENTFILE="OGAgentSetup-${OGVERSION/pre/}.exe" TMPDIR="$(ogGetPath "$MNTDIR/Windows/Temp")" - eval $DOWNLOAD "$TMPDIR/$OGAGENTFILE" "https://$(ogGetServerIp)/opengnsys/descargas/$OGAGENTFILE" 2>/dev/null if ogListSoftware $1 $2 | grep -qi "opengnsys agent"; then echo "OGAgent for Windows is already installed, you need to uninstall it before re-install." else - if [ -s "$TMPDIR/$OGAGENTFILE" ]; then + if eval $DOWNLOAD "$TMPDIR/$OGAGENTFILE" "https://$(ogGetServerIp)/opengnsys/descargas/$OGAGENTFILE" 2>/dev/null; then # Run once OGAgent Installer. if hivexsh -w << EOT 2>/dev/null; then load $HIVE @@ -68,7 +67,7 @@ EOT exit $OG_ERR_NOTFOUND fi fi - ;; + ;; Linux) # OGAgent for Linux (only deb and redhat-based backages; TODO suse-based package). if ogListSoftware $1 $2 | grep -qi "ogagent"; then echo "OGAgent for Linux is already installed, you need to uninstall it before re-install." @@ -76,20 +75,19 @@ EOT SYSTEMDDIR="$MNTDIR/lib/systemd" [ -d "$SYSTEMDDIR" -a -d "${SYSTEMDDIR/lib/etc}" ] || ogRaiseError $OG_ERR_NOTFOUND "$1 $2 systemd" || exit $OG_ERR_NOTFOUND # Downloading OGAgent installer for Linux. - if [ -e $MNTDIR/etc/debian_version ]; then # Debian-based + if [ -e $MNTDIR/etc/debian_version ]; then # Debian-based OGAGENTFILE="ogagent_${OGVERSION/pre/}_all.deb" CODE="if ! dpkg -l ogagent &>/dev/null && [ -f /var/tmp/$OGAGENTFILE ]; then apt-get update; apt-get install -y /var/tmp/$OGAGENTFILE; fi" - fi - if [ -e $MNTDIR/etc/redhat-release ]; then # RedHat-based - OGAGENTFILE="ogagent-${OGVERSION/pre/}-1.noarch.rpm" + fi + if [ -e $MNTDIR/etc/redhat-release ]; then # RedHat-based + OGAGENTFILE="ogagent-${OGVERSION/pre/}-1.noarch.rpm" CODE="if ! rpm -q ogagent &>/dev/null && [ -f /var/tmp/$OGAGENTFILE ]; then yum install -y /var/tmp/$OGAGENTFILE; fi" - fi - [ -n "$OGAGENTFILE" ] || ogRaiseError $OG_ERR_NOTFOUND "$1 $2 ogagent" || exit $OG_ERR_NOTFOUND + fi + [ -n "$OGAGENTFILE" ] || ogRaiseError $OG_ERR_NOTFOUND "$1 $2 ogagent" || exit $OG_ERR_NOTFOUND TMPDIR="$MNTDIR/var/tmp" - eval $DOWNLOAD "$TMPDIR/$OGAGENTFILE" "https://$(ogGetServerIp)/opengnsys/descargas/$OGAGENTFILE" 2>/dev/null - if [ -s "$TMPDIR/$OGAGENTFILE" ]; then - # Creating systemd script. - cat << EOT > $SYSTEMDDIR/systemd-launchogagent + if eval $DOWNLOAD "$TMPDIR/$OGAGENTFILE" "https://$(ogGetServerIp)/opengnsys/descargas/$OGAGENTFILE" 2>/dev/null; then + # Creating systemd script. + cat << EOT > $SYSTEMDDIR/systemd-launchogagent #!/bin/bash [ $EUID = 0 ] || exit 4 start() { @@ -108,12 +106,12 @@ restart() { } case "\$1" in - start|restart) "\$1" ;; + start|restart) "\$1" ;; esac EOT chmod +x $SYSTEMDDIR/systemd-launchogagent - # Creating systemd service. - cat << EOT > $SYSTEMDDIR/system/launchogagent.service + # Creating systemd service. + cat << EOT > $SYSTEMDDIR/system/launchogagent.service [Unit] Description=Installing and configuring OGAgent @@ -127,21 +125,21 @@ TimeoutStartSec=5min WantedBy=multi-user.target EOT ln -fs /lib/systemd/system/launchogagent.service \ - ${SYSTEMDDIR/lib/etc}/system/multi-user.target.wants - echo "Scheduled OGAgent installation at next boot" - echo " (process will be executed in the background, do not shutdown until finish)." + ${SYSTEMDDIR/lib/etc}/system/multi-user.target.wants + echo "Scheduled OGAgent installation at next boot" + echo " (process will be executed in the background, do not shutdown until finish)." else ogRaiseError $OG_ERR_NOTFOUND "$1 $2 /var/tmp/$OGAGENTFILE" exit $OG_ERR_NOTFOUND fi fi - ;; + ;; MacOS) # OGAgent for macOS (TODO). - echo "OGAgent installer for macOS is not implemented yet." - ;; + echo "OGAgent installer for macOS is not implemented yet." + ;; *) # OS not detected or OGAgent not implemented. ogRaiseError $OG_ERR_NOTOS "$1 $2" exit $OG_ERR_NOTOS - ;; + ;; esac diff --git a/client/shared/scripts/restoreBaseImage b/client/shared/scripts/restoreBaseImage index 0b291518..046c4658 100755 --- a/client/shared/scripts/restoreBaseImage +++ b/client/shared/scripts/restoreBaseImage @@ -3,7 +3,7 @@ # restoreBaseImage #@brief Script de ejemplo para restaurar una imagen #@brief Se usa como base para el programa de restauración de imágenes de OpenGnsys Admin). -#@param 1 REPO|CACHE +#@param 1 REPO|CACHE|IPREPO #@param 2 imagen #@param 3 disco #@param 4 particion @@ -22,14 +22,17 @@ #@version 1.0 - restauración de imagen con sincronizacion. #@author #@date 2012-12-04 +#@version 1.1.1 - Varios repositorios para un mismo cliente (ticket #679). +#@author Irina Gomez - ETSII Universidad de Sevilla +#@date 2018/11/06 #*/ ## -trap "onexit $1 \"$2\" $3 $4" 1 2 3 6 9 14 15 EXIT +trap "onexit $REPO \"$2\" $3 $4" 1 2 3 6 9 14 15 EXIT # Si salimos con error demontamos la imagen y desbloqueamos la imagen y la particion function onexit() { local exit_status=$? - ogUnmountImage "$1" "$2" "$IMGEXT" &>/dev/null + ogUnmountImage "$REPO" "$2" "$IMGEXT" &>/dev/null [ $exit_status -ne 4 ] && ogUnlock $3 $4 &>/dev/null exit $exit_status } @@ -54,6 +57,21 @@ fi [ $# -lt 4 ] && exit $(ogRaiseError session $OG_ERR_FORMAT "$MSG_FORMAT: $PROG REPO|CACHE imagen ndisco nparticion [ UNICAST|MULTICAST|TORRENT ] [opciones protocolo]"; echo $?) +# Procesar parámetros de entrada +REPO="${1^^}" +# No permite directorios diferentes para OU +OGUNIT="" + +# Si es una ip y es igual a la del equipo restaura desde cache +[ "$REPO" == "$(ogGetIpAddress)" ] && REPO="CACHE" +# Si es una ip y es distinta a la del recurso samba cambiamos de REPO. +ogCheckIpAddress $REPO +if [ $? == 0 -o $REPO == "REPO" ] ; then + # Si falla el cambio -> salimos con error repositorio no valido + ogChangeRepo $REPO ${OGUNIT%/} || exit $(ogRaiseError $OG_ERR_NOTFOUND '$REPO $OGUNIT'; echo $?) + REPO="REPO" +fi + # Carga del configurador del engine [ -z $OGENGINECONFIGURATE ] && source /opt/opengnsys/etc/engine.cfg @@ -62,17 +80,17 @@ REPOFILE="$(ogGetPath "REPO" "$2.$IMGEXT")" [ -n "$REPOFILE" ] || exit $(ogRaiseError session $OG_ERR_NOTFOUND "REPO, $2.$IMGEXT"; echo $?) # Comprobar que es sincronizable (con REPO) -ogIsSyncImage REPO "$2" $IMGEXT || exit $(ogRaiseError session $OG_ERR_DONTSYNC_IMAGE "$1 $2"; echo $?) +ogIsSyncImage REPO "$2" $IMGEXT || exit $(ogRaiseError session $OG_ERR_DONTSYNC_IMAGE "$REPO $2"; echo $?) IMGEXT="img" # Comprobamos si la imagen o la particion estan bloqueada: -ogIsImageLocked "REPO" "$2.$IMGEXT" && exit $(ogRaiseError session $OG_ERR_LOCKED "$1 $2.$IMGEXT"; echo $?) +ogIsImageLocked "REPO" "$2.$IMGEXT" && exit $(ogRaiseError session $OG_ERR_LOCKED "$REPO $2.$IMGEXT"; echo $?) ogIsLocked "$3" "$4" && exit $(ogRaiseError session $OG_ERR_LOCKED "$3 $4"; echo $?) # Detectamos el sistema de ficheros de la imagen # TODO ogGetImageInfo DIRMOUNT=$(ogMountImage "REPO" "$2") -ogWaitSyncImage "REPO" "$2" "$IMGEXT" "mounted" || exit $(ogRaiseError session $OG_ERR_DONTMOUNT_IMAGE "$1 $2 $IMGEXT: time_out."; echo $?) +ogWaitSyncImage "REPO" "$2" "$IMGEXT" "mounted" || exit $(ogRaiseError session $OG_ERR_DONTMOUNT_IMAGE "$REPO $2 $IMGEXT: time_out."; echo $?) IMGFSTYPE=$(head -1 $DIRMOUNT/ogimg.info |cut -d: -f3) # Comprobamos si el sistema de ficheros se puede montar @@ -89,7 +107,7 @@ fi PROTO=${5:-"UNICAST"} -if [ "$1" == "CACHE" -o "$1" == "cache" ]; then +if [ "$REPO" == "CACHE" -o "$REPO" == "cache" ]; then # Las imagenes sincronizables aunque sean iguales no tienen el mismo sum. # Sincronizamos si existe el fichero y si no usamos updateCache. ogEcho log session "[10] $MSG_SCRIPTS_TASK_START updateCache REPO $2.$IMGEXT $PROTO $6" @@ -107,20 +125,20 @@ if [ "$1" == "CACHE" -o "$1" == "cache" ]; then ogEcho log session " $MSG_SCRIPTS_TASK_END, $MSG_SCRIPTS_TIME_PARTIAL : $[TIMEAUX1/60]m $[TIMEAUX1%60]s" # Montamos la imagen de cache - ogMountImage "$1" "$2" >/dev/null - ogWaitSyncImage "$1" "$2" "$IMGEXT" "mounted" || exit $(ogRaiseError session $OG_ERR_DONTMOUNT_IMAGE "$1 $2 $IMGEXT: time_out."; echo $?) + ogMountImage "$REPO" "$2" >/dev/null + ogWaitSyncImage "$REPO" "$2" "$IMGEXT" "mounted" || exit $(ogRaiseError session $OG_ERR_DONTMOUNT_IMAGE "$REPO $2 $IMGEXT: time_out."; echo $?) fi TIME2=$SECONDS # Restaurar la imagen. -ogEcho log session "[40] $MSG_HELP_ogRestoreImage: $1 $2 $3 $4" +ogEcho log session "[40] $MSG_HELP_ogRestoreImage: $REPO $2 $3 $4" ogLock $3 $4 # Sincronizamos la partición con la imagen. -ogEcho log session "[60] $MSG_HELP_ogSyncRestore: $1 $2 $IMGEXT $3 $4" -ogSyncRestore "$1" "$2" "$IMGEXT" $3 $4 +ogEcho log session "[60] $MSG_HELP_ogSyncRestore: $REPO $2 $IMGEXT $3 $4" +ogSyncRestore "$REPO" "$2" "$IMGEXT" $3 $4 RETVAL=$? [ $RETVAL == 0 ] || ogEcho session warning "$MSG_ERR_SYNCHRONIZING" @@ -128,7 +146,7 @@ TIMEAUX2=$[SECONDS-TIME2] ogEcho log session " $MSG_SCRIPTS_TASK_END, $MSG_SCRIPTS_TIME_PARTIAL : $[TIMEAUX2/60]m $[TIMEAUX2%60]s" # Desmontamos imagen basica. -ogUnmountImage "$1" "$2" "$IMGEXT" +ogUnmountImage "$REPO" "$2" "$IMGEXT" # Restableciendo acl ogUnlock $3 $4 @@ -141,7 +159,7 @@ if [ "$(ogGetCaller)" != "restoreDiffImage" ];then ogExecAndLog command ogRestoreAclImage $3 $4 if which configureOsCustom &>/dev/null; then ogEcho log session "[90] configureOsCustom" - configureOsCustom "$3" "$4" "$1" "$2" + configureOsCustom "$3" "$4" "$REPO" "$2" else ogEcho log session "[90] $MSG_HELP_configureOs" configureOs $3 $4 diff --git a/client/shared/scripts/restoreDiffImage b/client/shared/scripts/restoreDiffImage index 7d16ef90..4de5f31a 100755 --- a/client/shared/scripts/restoreDiffImage +++ b/client/shared/scripts/restoreDiffImage @@ -24,14 +24,17 @@ #@version 1.0 - restauración de imagen con sincronizacion. #@author #@date 2012-12-04 +#@version 1.1.1 - Varios repositorios para un mismo cliente (ticket #679). +#@author Irina Gomez - ETSII Universidad de Sevilla +#@date 2018/11/06 #*/ ## -trap "onexit $1 \"$2\" \"$3\" $4 $5" 1 2 3 6 9 14 15 EXIT +trap "onexit $REPO \"$2\" \"$3\" $4 $5" 1 2 3 6 9 14 15 EXIT # Si salimos con error demontamos la imagen y desbloqueamos la imagen y la particion function onexit() { local exit_status=$? - ogUnmountImage "$1" "$3" "$DIFFTYPE" &>/dev/null + ogUnmountImage "$REPO" "$3" "$DIFFTYPE" &>/dev/null [ $exit_status -ne 4 ] && ogUnlock $4 $5 &>/dev/null exit $exit_status } @@ -59,27 +62,41 @@ ogEcho log session "[1] $MSG_SCRIPTS_START $0 $*" # Procesar parámetros de entrada DIFFTYPE="diff" DIFFEXT="img.diff" +REPO="${1^^}" +# No permite directorios diferentes para OU +OGUNIT="" + +# Si es una ip y es igual a la del equipo restaura desde cache +[ "$REPO" == "$(ogGetIpAddress)" ] && REPO="CACHE" +# Si es una ip y es distinta a la del recurso samba cambiamos de REPO. +ogCheckIpAddress $REPO +if [ $? == 0 -o $REPO == "REPO" ] ; then + # Si falla el cambio -> salimos con error repositorio no valido + ogChangeRepo $REPO ${OGUNIT%/} || exit $(ogRaiseError $OG_ERR_NOTFOUND '$REPO $OGUNIT'; echo $?) + REPO="REPO" +fi + REPODIFFFILE="$(ogGetPath "REPO" "$3.$DIFFEXT")" [ -n "$REPODIFFFILE" ] || exit $(ogRaiseError session $OG_ERR_NOTFOUND "REPO $3.$DIFFEXT";echo $?) # Comprobamos si la imagen o la particion estan bloqueada: -ogIsImageLocked "$1" "$3.$DIFFEXT" && exit $(ogRaiseError session $OG_ERR_LOCKED "$1 $3.$DIFFEXT";echo $?) +ogIsImageLocked "$REPO" "$3.$DIFFEXT" && exit $(ogRaiseError session $OG_ERR_LOCKED "$REPO $3.$DIFFEXT";echo $?) ogIsLocked "$4" "$5" && exit $(ogRaiseError session $OG_ERR_LOCKED "$4 $5";echo $?) -PART=$(ogDiskToDev "$4" "$5" 2>/dev/null ) || exit $(ogRaiseError session $OG_ERR_PARTITION "$1 $3";echo $?) +PART=$(ogDiskToDev "$4" "$5" 2>/dev/null ) || exit $(ogRaiseError session $OG_ERR_PARTITION "$REPO $3";echo $?) # Carga del configurador del engine [ -z $OGENGINECONFIGURATE ] && source /opt/opengnsys/etc/engine.cfg # Comprobar que es sincronizable -ogIsSyncImage REPO "$3" diff || exit $(ogRaiseError session $OG_ERR_DONTSYNC_IMAGE "$1 $3";echo $?) +ogIsSyncImage REPO "$3" diff || exit $(ogRaiseError session $OG_ERR_DONTSYNC_IMAGE "$REPO $3";echo $?) # Restauramos la imagen Basica. -restoreBaseImage $1 "$2" "$4" "$5" "$6" "$7" +restoreBaseImage $REPO "$2" "$4" "$5" "$6" "$7" PROTO=${6:-"UNICAST"} -if [ "$1" == "CACHE" -o "$1" == "cache" ]; then +if [ "$REPO" == "CACHE" -o "$REPO" == "cache" ]; then ogEcho log session "[10] $MSG_HELP_updateCache." ogEcho log session " updateCache REPO" "/$3.$DIFFEXT" "$PROTO" "$7" updateCache REPO "/$3.$DIFFEXT" "$PROTO" "$7" @@ -101,20 +118,20 @@ TIME2=$SECONDS ogEcho log session "[40] $MSG_RESTORE $PART" # Montamos la diferencial -ogMountImage "$1" "$3" "$DIFFTYPE" &>/dev/null +ogMountImage "$REPO" "$3" "$DIFFTYPE" &>/dev/null # Comprobar que la imagen diferencial se ha montado -ogWaitSyncImage "$1" "$3" "$DIFFTYPE" "mounted" || exit $(ogRaiseError session $OG_ERR_DONTMOUNT_IMAGE "$1 $3 $DIFFTYPE: time_out $TIMEAUX seg.";echo $?) +ogWaitSyncImage "$REPO" "$3" "$DIFFTYPE" "mounted" || exit $(ogRaiseError session $OG_ERR_DONTMOUNT_IMAGE "$REPO $3 $DIFFTYPE: time_out $TIMEAUX seg.";echo $?) ogMount $4 $5 >/dev/null ogLock $4 $5 # Sincronizamos la partición con la imagen. -ogEcho log session "[60] $MSG_HELP_ogSyncRestore: $1 $3 $DIFFTYPE $4 $5" -ogSyncRestore "$1" "$3" "$DIFFTYPE" $4 $5 +ogEcho log session "[60] $MSG_HELP_ogSyncRestore: $REPO $3 $DIFFTYPE $4 $5" +ogSyncRestore "$REPO" "$3" "$DIFFTYPE" $4 $5 RETVAL=$? [ $RETVAL == 0 ] || ogEcho session warning "$MSG_ERR_SYNCHRONIZING" # Desmontamos la imagen -ogUnmountImage "$1" "$3" "$DIFFTYPE" +ogUnmountImage "$REPO" "$3" "$DIFFTYPE" ogUnlock $4 $5 TIMEAUX2=$[SECONDS-TIME2] @@ -130,7 +147,7 @@ ogEcho log session " $MSG_SCRIPTS_TASK_END, $MSG_SCRIPTS_TIME_PARTIAL : $[T # Llamar al script de post-configuración del sistema operativo. if which configureOsCustom &>/dev/null; then ogEcho log session "[90] configureOsCustom" - configureOsCustom "$4" "$5" "$1" "$2" + configureOsCustom "$4" "$5" "$REPO" "$2" else ogEcho log session "[90] $MSG_HELP_configureOs." configureOs $4 $5 diff --git a/client/shared/scripts/samples/firstRunOnceWindows b/client/shared/scripts/samples/firstRunOnceWindows new file mode 100644 index 00000000..00a6e071 --- /dev/null +++ b/client/shared/scripts/samples/firstRunOnceWindows @@ -0,0 +1,68 @@ +#!/bin/bash +#/** +#@file FirstRunOnceWindows +#@brief Guión de rutinas que se ejecutarán en los windows con teclado y raton desactivados. +#@param $1 número de disco +#@param $2 número de particion +#@exception OG_ERR_FORMAT 1 formato incorrecto. +#@exception OG_ERR_NOTFOUND 2 fichero de imagen o partición no detectados. +#@exception OG_ERR_PARTITION 3 # Error en partición de disco. +#@exception OG_ERR_LOCKED 4 partición bloqueada por otra operación. +#@version 1.0.1 - primera version: desactivar/activar ratón y teclado +#@author Antonio J. Doblas Viso. +#@date 2017-02-23 +#**/ + + + +PROG="$(basename $0)" +if [ $# -lt 2 ]; then + ogRaiseError session $OG_ERR_FORMAT "$MSG_FORMAT: $PROG ndisco nparticion" + exit $? +fi + + +# Asignación de variables +## Bloque de variables de parámetros +DISK=$1 +PART=$2 +POSTCONF=postconf.cmd +### Bloque de variables basada en un archivo de claves: ADMIN PASSADMIN USER PASSUSER +source $OGETC/os.cfg $DISK $PART + + + +OSVERSION=$(ogGetOsVersion $1 $2) +case "$OSVERSION" in + *Windows*) + # Desactivamos el telcado y el ratón + ogSetRegistryValue $(ogMount $DISK $PART) SYSTEM '\ControlSet001\Services\kbdclass\Start' 4 + ogSetRegistryValue $(ogMount $DISK $PART) SYSTEM '\ControlSet001\Services\mouclass\Start' 4 + + ## Indicación del proceso (variable $POSTCONF), usuario que lo ejecutará ($ADMIN) y configuración del windows para que arranque con autologin tras la postconfiguración (1 "$USER" "$PASSUSER") + echo "ogInstallMiniSetup $DISK $PART $POSTCONF $ADMIN $PASSADMIN 1 \"$USER\" \"$PASSUSER\" " + ogInstallMiniSetup $DISK $PART $POSTCONF $ADMIN $PASSADMIN 1 "$USER" "$PASSUSER" + ogAddCmd $DISK $PART $POSTCONF '@echo off' + ogAddCmd $DISK $PART $POSTCONF 'start "C:\Program Files\Internet Explorer\iexplore.exe" wwww.opengnsys.es' + ogAddCmd $DISK $PART $POSTCONF "timeout /t 200 /NOBREAK" + ogAddCmd $DISK $PART $POSTCONF "shutdown -r -t 300" + ogAddCmd $DISK $PART $POSTCONF 'start winword.exe' + ogAddCmd $DISK $PART $POSTCONF 'taskkill /F /IM winword.exe' + ogAddCmd $DISK $PART $POSTCONF 'REG ADD HKLM\SYSTEM\CurrentControlSet\Services\kbdclass\ /v Start /t REG_DWORD /d 3 /f' + ogAddCmd $DISK $PART $POSTCONF 'REG ADD HKLM\SYSTEM\CurrentControlSet\Services\mouclass\ /v Start /t REG_DWORD /d 3 /f' + ogAddCmd $DISK $PART $POSTCONF 'REG ADD HKLM\SYSTEM\ControlSet001\Services\kbdclass\ /v Start /t REG_DWORD /d 3 /f' + ogAddCmd $DISK $PART $POSTCONF 'REG ADD HKLM\SYSTEM\ControlSet001\Services\mouclass\ /v Start /t REG_DWORD /d 3 /f' + #ogAddCmd $DISK $PART $POSTCONF '"c:\Program Files\Toolwiz Time Freeze 2017\ToolwizTimeFreeze.exe" /freezealways /usepass=' + #ogAddCmd $DISK $PART $POSTCONF 'reg query "HKCU\SOFTWARE\Toolwiz\TimefreezeNew"' + + #ogAddCmd $DISK $PART $POSTCONF "cscript \"c:\Archivo de Programas (x86)\agua\aguac\scripts\MSOfficeActivate.vbs\" " + #ogAddCmd $DISK $PART $POSTCONF "del \"c:\Program Files (x86)\agua\aguac\scripts\MSWinActivate.vbs\" " + #unix2dos /mnt/sda1/Windows/System32/postconf.cmd + + ### reiniciamos el equipo + ogAddCmd $DISK $PART $POSTCONF "shutdown -r" + ### consultamos + cat $(ogMount $DISK $PART)/Windows/System32/$POSTCONF + + ;; +esac diff --git a/client/shared/scripts/samples/smartPartition b/client/shared/scripts/samples/smartPartition new file mode 100644 index 00000000..568ed322 --- /dev/null +++ b/client/shared/scripts/samples/smartPartition @@ -0,0 +1,62 @@ +#!/bin/bash +#/** +# smartPartition.template +#@brief particiona los clientes del laboratorio virtual. +#@param 1 +#@ejemplo: +#@return: Scripts de ejemplo para establecer particionado según tamaño. +#@exception OG_ERR_ NOTFOUND Disco duro no encontrador. +#@note +#@todo: +#@version 0.1 primera version +#@author adv +#@date 2018/07/08 + +#Calculamos el numero de discos +NDISK=$(ogDiskToDev | wc -w) + +#Si no hay discos, error +[ -z $NDISK ] && exit $(ogRaiseError $OG_ERR_NOTFOUND "ogDiskToDev | wc -w") + +#asignamos contador al primer disco de OpenGnsys +COUNTER=1 +until [ $COUNTER -gt $NDISK ]; do + ogUnmountAll $COUNTER + ogDeletePartitionTable $COUNTER + ogCreatePartitionTable $COUNTER MSDOS + ogUpdatePartitionTable $COUNTER + let COUNTER=COUNTER+1 +done + +#Establecemos las Particiones CACHE con tamaños diferentes según la capacidad del disco. +#Si el PC tiene dos discos duros, el segundo será completo para la CACHE. +#establecemos rangos de las capacidades con expresiones regulares: https://goo.gl/gJnK7g +case $NDISK in + 1) + #Calcular el tamaño máximo del disco duro redondeando a la baja en 500 MB para evitar problemas de calculo" + SIZE_DISK1=$(expr $(ogGetDiskSize 1) - 500000) + #entre 70 y 73'9GB + ogCheckStringInReg $SIZE_DISK1 "^7[0-3][0-9]{6}$" && initCache 1 4 32000000 NOMOUNT + #entre 50 y 52'9 + ogCheckStringInReg $SIZE_DISK1 "^5[0-2][0-9]{6}$" && initCache 1 4 12000000 NOMOUNT + ;; + 2) + #Calcular el tamaño máximo del disco duro redondeando a la baja en 500 MB para evitar problemas de calculo" + SIZE_DISK2=$(expr $(ogGetDiskSize 1) - 500000) + initCache 2 4 $SIZE_DISK2 NOMOUNT + ;; +esac + +#El particionado para los sistemas operativos identicos para todos. +#Requiere tener una tabla de particiones previa. +ogCreatePartitions 1 NTFS:19000000 LINUX:19000000 EMPTY:0; + +#asignamos contador al primer disco de OpenGnsys +COUNTER=1 +until [ $COUNTER -gt $NDISK ]; do + ogBootMbrGeneric $COUNTER + ogSetPartitionActive 1 $COUNTER + ogListPartitions $COUNTER + ogGetPartitionActive $COUNTER + let COUNTER=COUNTER+1 +done diff --git a/doc/CHANGELOG.es.txt b/doc/CHANGELOG.es.txt index 9838335b..f04388d7 100644 --- a/doc/CHANGELOG.es.txt +++ b/doc/CHANGELOG.es.txt @@ -3,19 +3,76 @@ LISTA DE CAMBIOS CHANGELOG.es.txt -Lista de cambios incluidos en OpenGnsys 1.1.1 Espeto ----------------------------------------------------- +Lista de cambios incluidos en OpenGnsys 1.1.1 (Espeto) +------------------------------------------------------ + +Tickets resueltos en módulo OpenGnsys Cloning Engine: +#853 Revisar autodocumentación con doxygen +#863 smartPartition: incluir scritps de ejemplo de particionado personalizado para múltiples d +iscos duros +#864 FirstRunOnceWindows: scripts de ejemplo para installMiniSetup con ratón y teclado desacti +vado +#866 Si al restaurar usando la cache no hay espacio en la misma se finalizará la acción + +Tickets resueltos en módulo OpenGnsys Client: +#847 La ISO del ogLive debe de utilzar la revisión de Git y no de SVN + +Tickets resueltos en módulo OpenGnsys Server: +#856 Mejoras en setserveraddr + +Tickets resueltos en módulo OpenGnsys Repository Server: +#873 Script para importar imagen de otro repositorio +#875 Eliminar el servicio inactivo ogAdmRepo Tickets resueltos en módulo OpenGnsys Web Admin Console: #772 Módulo de administración web para dispositivos smartphones y tablets (no se resolverá) +#804 Conversión de todo el código php de la consola web de administración a Php7 y Mysqli (tarea) #816 Marcar ordenador de profesor #824 Iniciar sistema restaurado (no integrado) -#835 Problemas al listar plantillas en Nerboot Avanzado +#842 Internacionalización de la consola web + +Tickets resueltos en módulo OpenGnsys Installer: +#784 Mejorar rendimiento de PHP sobre Apache +#869 Compatibilidad de servidor con Ubuntu 18.04 LTS y CentOS 7.x Tickets genéricos resueltos: #843 Incluir nombre de versión +Lista de cambios incluidos en OpenGnsys 1.1.0a (versión de mantenimiento) +---------------------------------------------- + +Tickets resueltos en módulo OpenGnsys Cloning Engine: +#851 Ampliar parámetros de una sesión multicast para los clientes (corrección) +#868 ConfiguraOs: error al desinstalar el agente de sistema operativo antiguo (corrección) +#871 Error al crear particiones lógicas en discos con sectores de 4 KB (corrección) + +Tickets resueltos en módulo OpenGnsys Client: +#852 Apagado del cliente si tiempo de espera cambia de día (corrección) + +Tickets resueltos en módulo OpenGnsys Server: +#846 Configuración de logrotate para que incluya todos los servicios de OpenGnsys (corrección) +#859 Gestor de los ficheros PXE duplicado + +Tickets resueltos en módulo OpenGnsys Repository Server: +#850 Problema con repositorio recién instalado (corrección) + +Tickets resueltos en módulo OpenGnsys Web Admin Console: +#835 Problemas al listar plantillas en Nerboot Avanzado (corrección) +#849 Incorporar ordenadores de dhcp no admite comentarios tras la declarción de un host (corrección) +#867 La ayuda en la consola incluirá más información +#870 Netboot avanzado no crea la plantilla de arranque si el equipo no tiene asignado un repositorio (corrección) + +Tickets resueltos en módulo OpenGnsys Installer: +#876 Problemas al actualizar desde Subversion a Git (corrección) + +Tickets genéricos resueltos: +#839 Errores detectado en API REST para Remote PC (corrección) +#840 Usar Git como repositorio de código +#865 Problemas con Trac (corrección) +#872 Liberar versión de mantenimiento OpenGnsys 1.1.0a + + Lista de cambios incluidos en OpenGnsys 1.1.0 --------------------------------------------- @@ -27,7 +84,7 @@ Tickets resueltos en módulo OpenGnsys Cloning Engine: #678 Unidades organizativas con directorio de imágenes separado (mejora) #716 Revisión ogCleanLinuxDevices #722 Multicast entre subredes (mejora) -#726 Reducir el registro de errores y avisos en algunas operaciones +#726 Reducir el registro de errores y avisos en algunas operaciones #727 ogGrubHidePartitions comprueba tipo de partición con blkid en vez revisar las entradas del Grub #731 Soporte para cualquier versión de Windows #740 Clonar disco completo en modo "raw" @@ -60,6 +117,7 @@ Tickets resueltos en módulo OpenGnsys Client: #774 Soportar clientes ogLive de 64 bits #783 Browser registra salida de comandos ejecutados al pulsar enlace (mejora) #786 Adaptar el ogLive-precise-3.2.0-23-generic-r4820.iso como ogLive de 32 bits +#788 grubSyntax compatible con grub_probe version 1.99 #813 Restaurar Imagen no muestra el error en la cola de acciones Tickets resueltos en módulo OpenGnsys Server: @@ -74,8 +132,8 @@ Tickets resueltos en módulo OpenGnsys Repository Server: #379 Usar identificador de operación para el ogAdmRepoAux (no se resolverá) #701 torrent-creator falla si el fichero de imagen a procesar no es válido #743 Funcion en el webservice API REST para wakeonlan (mejora) -#810 API REST de respositorio para listado de imágenes -#820 checkperms da error al cambiar permisos sobre el directorio de agrupamiento de imágenes en el repo +#810 API REST de respositorio para listado de imágenes +#820 checkperms da error al cambiar permisos sobre el directorio de agrupamiento de imágenes en el repo Tickets resueltos en módulo OpenGnsys Web Admin Console: #372 Comandos y asistentes deberían limitar equipos de operación dentro de ámbito @@ -95,18 +153,18 @@ Tickets resueltos en módulo OpenGnsys Web Admin Console: #778 Codificar claves de usuarios (mejora) #779 Crear comando "Enviar mensaje" #782 Crear registro de acciones para realizar informes -#789 Actualizar plantilla PXE al mover ordenador +#789 Actualizar plantilla PXE al mover ordenador #792 Incluir en los html personalizados de ejemplo los enlaces al acceso privado #797 Revisar log en los procesos de restauración #798 Mostrar imágenes en orden alfabético -#799 Consola web: estado de los equipos tarda en mostar +#799 Consola web: estado de los equipos tarda en mostar #806 Comando Particionar y Formatear: controlar que no se exceda el tamaño del disco #807 Consola Web: Incorporar ordenadores da error de time-out #814 Sustituir las etiquetas cortas de php por el formato largo #817 Correcciones al formulario propiedades del aula -#818 Actualización ficheros PXE tras modificar propiedad de IP del repositorio -#819 Eliminar un objeto ordenador no elimina fichero PXE -#821 Comando Particionar sólo funciona correctamente en al ámbito de tipo ordenador +#818 Actualización ficheros PXE tras modificar propiedad de IP del repositorio +#819 Eliminar un objeto ordenador no elimina fichero PXE +#821 Comando Particionar sólo funciona correctamente en al ámbito de tipo ordenador #822 Llamar al updateBootCache desde el particionado de la cache #828 Identificador de perfil hardware disponible desde el ogLive y eliminación de winboot @@ -864,7 +922,7 @@ Tickets resueltos en módulo OpenGnSys Cloning Engine: #61 ogListPartitions muestra el tipo de sistemas de archivos de la particion y no el tipo de partición en cuestión #71 ogListPartitions falla con partición extendida #73 Mensajes de error en particiones vacías -#75 Arrancar sistemas Linux en partición distinta a la original +#75 Arrancar sistemas Linux en partición distinta a la original #85 ogCreateImage no crea los subdirectorios del path indicado #86 ogRestoreImage siempre añade a la imagen pasada como parámetro la subcadena ".img" #87 Engine no se adapta a la sintaxis Doxygen diff --git a/doc/COMPATIBILITY.en.txt b/doc/COMPATIBILITY.en.txt new file mode 100644 index 00000000..0e79796e --- /dev/null +++ b/doc/COMPATIBILITY.en.txt @@ -0,0 +1,25 @@ + +OpenGnsys 1.1.1 (Espeto) Compatibility Notes +============================================== + + +OpenGnsys Administration Server and Repository Manager +------------------------------------------------------ + +Installation of OpenGnsys services has been tested on the following GNU/Linux distributions: + + - Ubuntu Server 18.04 LTS 64-bit (recommended) + - Ubuntu Server 16.04 LTS 64-bit (not fully tested) + - CentOS 7.5 64-bit (not fully tested) + + +OpenGnsys Clients +----------------- + +Installation and cloning operations have been tested on the following operating systems and filesystems: + + - Ubuntu Desktop 16.04.4 64-bit and 18.04.1 64-bit with Ext4 filesystem and Swap partition + - Windows 7 Enterprise 64-bit with NTFS filesystem + - Windows 10 Education 1709 64-bit and 1803 64-bit with NTFS filesystem + + diff --git a/doc/INSTALL.en.txt b/doc/INSTALL.en.txt index ef57ea18..c731350b 100644..120000 --- a/doc/INSTALL.en.txt +++ b/doc/INSTALL.en.txt @@ -1,96 +1 @@ -Installing OpenGnsys Server 1.1.1 (codename "Espeto") -===================================================== - -Before installation -------------------- - -OpenGnsys Server 1.1.1 (Espeto) is mean to be installed under Ubuntu Server 16.04 LTS or newer, though it has also been tested under operating systems based on CentOS 7. - -Network connection is needed in order to download the required packages, the source code and the preconfigured client. - -Minimum storage requirements: -- 100 MB in /tmp (for the installation process) -- 600 MB in /var/lib/tftpboot (or /srv in Debian systems) for every installed ogLive client. -- 250 MB in the installation folder (/opt/opengnsys) plus 600 MB for every downloaded ISO image. -- Enough disk space for the image repository in /opt/opengnsys/images (it is recommended to mount it on an independent file system) - - - -Installing ----------- - -To install OpenGnsys, run opengnsys_installer.sh script after unpacking the release file (opengnsys-release.tar.gz) o downloading it directly from https://raw.githubusercontent.com/opengnsys/OpenGnsys/devel/installer/opengnsys_installer.sh - -Unpacking example: - tar xvzf opengnsys-1.1.0.tar.gz - cd opengnsys/installer - -Download examples: - - * Download with wget. - wget https://raw.githubusercontent.com/opengnsys/OpenGnsys/devel/installer/opengnsys_installer.sh - - * Download with curl. - curl https://raw.githubusercontent.com/opengnsys/OpenGnsys/devel/installer/opengnsys_installer.sh -o opengnsys_installer.sh - - -You must be root to run the installation script: - sudo bash opengnsys_installer.sh - - -The following information will be requested in order to configure the access to the service (a default value will be introduced if no parameter is indicated): - * MySQL root password - * Web console user and OpenGnsys Super Administrator - * Web console user's password - * Client's password for accessing remote services - * Choose which ogLive clients to install. - - -The following processes will be carried out: - * Gathering of the basic network parameters. - * Checking installed packages. - * Downloading and installing dependencies. - * Creating OpenGnsys basic folder sctructure. - * Download code from the repository to a temporal folder (/tmp/opengnsys_installer). In upcoming releases this process will not be necessary. - * Compiling and installing OpenGnsys services. - * Basic configuration of OpenGnsys network services (DHCP, PXE and Samba) using the existing configuration templates. - * Copying additional server management files. - * Creating database and configuring OpenGnsys administration console web server. - * Copying administration console pages. - * Copying OpenGnsys client folder structure. - * Downloading OpenGnsys client initial image. - * Basic configuration of OpenGnsys services using network parameters. - -Once the installation process is finished, you can start working with the system: - * Configuring DHCP. - * Adding information in the administration console. - * Customizing administration scripts. - * Creating start menus for the clients. - - - -Updating / upgrading --------------------- - -There is a system self-upgrading script with the following features: - * Network connection is needed to obtain the latest updates / upgrades. - * If the script updates itself, then it must be run once again. - * Services depending on the operating system will not be updated. - * Configuration files will not be modified. - -You must be root to run this script: - sudo /opt/opengnsys/lib/opengnsys_update.sh - - - -Uninstalling ------------- - -There is also an uninstallation script to remove the OpenGnsys components: - * OpenGnsys files and database will be deleted. - * Operating system packages and their configuration files will be preserved. - * The image folder and its content will not be deleted. - -You must be root to run this script: - sudo /opt/opengnsys/lib/opengnsys_uninstall.sh - +../installer/INSTALL.en.txt
\ No newline at end of file diff --git a/doc/INSTALL.es.txt b/doc/INSTALL.es.txt index 280ba648..b4274ba4 100644..120000 --- a/doc/INSTALL.es.txt +++ b/doc/INSTALL.es.txt @@ -1,100 +1 @@ -Instalación de OpenGnsys Server 1.1.1 (Espeto) -============================================== - -Notas iniciales ---------------- - -Se presupone que el servidor de OpenGnsys va a ser instalado en una distribución del sistema operativo Ubuntu Server a partir de la versión 16.04 LTS (también ha sido probado en sistemas basados en CentOS 7). - -El serividor debe tener acceso a Internet para descargar los paquetes necesarios, el código del proyecto y el cliente preconfigurado. - -Requisitos mínimos de almacenamiento: -- 100 MB en el directorio /tmp (solo durante la instalación) -- 600 MB en el directorio /var/lib/tftpboot (o /srv en sistemas Debian) por cada cliente ogLive que se desee instalar. -- 250 MB en el directorio de instalación /opt/opengnsys más 600 MB por cada imagen ISO descargada de clientes ogLive. -- Estimar la capacidad necesaria para el repositorio de imágenes en /opt/opengnsys/images (es recomendable que este directorio se monte sobre un sistema de archivos independiente). - - -Instalación ------------ - -La instalación de OpenGnsys se realiza ejecutando el script de instalación opengnsys_installer.sh, el cual puede obtenerse descomprimiendo el fichero de la versión opengnsys-Version.tar.gz o descargándolo directamente de la dirección: https://raw.githubusercontent.com/opengnsys/OpenGnsys/devel/installer/opengnsys_installer.sh - -Ejemplos de descompresión del programa: - - tar xvzf opengnsys-1.1.0.tar.gz - cd opengnsys/installer - -Ejemplos de descarga con varias herramientas: - - * Descargar con wget. - wget https://raw.githubusercontent.com/opengnsys/OpenGnsys/devel/installer/opengnsys_installer.sh - - * Descargar con curl. - curl https://raw.githubusercontent.com/opengnsys/OpenGnsys/devel/installer/opengnsys_installer.sh -o opengnsys_installer.sh - - -El script de instalación debe ser ejecutado como usuario root: - sudo bash opengnsys_installer.sh - - -Dicho script solicitará por teclado la siguiente información para configurar el acceso al servicio (si no se indica un parámetro, toma el valor por defecto): - * Clave del usuario root de MySQL. - * Usuario de acceso a la consola web y super-administrador de OpenGnsys. - * Clave del usuario de acceso a la consola web. - * Clave de acceso del cliente a servicios remotos. - * Seleccionar cliente(s) ogLive para instalar. - -Se realizan los siguientes procesos: - * Obtener los parámetros básicos de la red. - * Comprobar los paquetes instalados. - * Descargar e instalar las dependencias que faltan. - * Crear la estructura básica de directorios de OpenGnsys. - * Descargar el repositorio de código en un directorio temporal (/tmp/opengnsys_installer). Nota: en versiones futuras este proceso no será necesario. - * Compilar e instalar los servicios de OpenGnsys. - * Configuración básica de los serviciios de red DHCP, PXE y NFS/Samba a partir de las plantillas de configuración - * Copiar ficheros complementarios de gestión del servidor. - * Crear la base de datos y configurar el servidor web de OpenGnsys Web Admin Console. - * Copiar los ficheros de las páginas de Web Admin Console. - * Copiar la estructura de directorios de OpenGnsys Client. - * Descargar la o las imágenes iniciales de OpenGnsys Client. - * Configuración básica de los serviciios de OpenGnsys a partir de los parámetros de red. - -Una vez finalizada la ejecución del instalador, puede empezarse a trabajar con el sistema: - * Configurar DHCP. - * Añadir datos en la consola de administración. - * Personalizar scripts de administración. - * Definir menús de inicio para los clientes. - - - -Actualización -------------- - -Se dispone de un script de auto-actualización del sistema, con las siguientes características: - * Es necesario conexión a Internet para obtener las últimas actualizaciones. - * Si el script se actualiza a sí mismo, debe ser ejecutado de nuevo. - * No se actualizan los servicios asociados al sistema operativo. - * No se modifican los ficheros de configuración. - - -El script debe ser ejecutado como usuario root: - sudo /opt/opengnsys/lib/opengnsys_update.sh - - - -Desinstalación --------------- - -También existe un script de desinstalación de los componentes de OpenGnsys, con las siguientes características: - * Solicita confirmación para ejecutar sus operaciones. - * Se eliminan los ficheros de OpenGnsys y su base de datos. - * No se eliminan ni paquetes del sistema operativo ni sus ficheros de configuración. - * No se elimina el directorio de las imágenes ni su contenido. - * No se eliminan los clientes ogLive ni las plantillas PXE. - - -El script debe ser ejecutado como usuario root: - sudo /opt/opengnsys/lib/opengnsys_uninstall.sh - - +../installer/INSTALL.es.txt
\ No newline at end of file diff --git a/installer/INSTALL.en.txt b/installer/INSTALL.en.txt index a98b7931..23698972 100644 --- a/installer/INSTALL.en.txt +++ b/installer/INSTALL.en.txt @@ -1,37 +1,95 @@ +Installing OpenGnsys Server 1.1.1 (Espeto) +========================================== -Installing and updating OpenGnsys -================================= +Before installation +------------------- +OpenGnsys Server 1.1.1 (codename "Espeto") is meant to be installed under Ubuntu Server 16.04 LTS or newer, though it has also been tested under operating systems based on CentOS 7 (read COMPATIBILITY.en.txt for more details). +Network connection is needed in order to download the required packages, the source code and the preconfigured client. -Installing OpenGnsys --------------------- +Minimum storage requirements: +- 100 MB in /tmp (for the installation process) +- 600 MB in /var/lib/tftpboot (or /srv in Debian systems) for every installed ogLive client. +- 250 MB in the installation folder (/opt/opengnsys) plus 600 MB for every downloaded ISO image. +- Enough disk space for the image repository in /opt/opengnsys/images (it is recommended to mount it on an independent file system) + + + +Installing +---------- + +To install OpenGnsys, run opengnsys_installer.sh script after unpacking the release file (opengnsys-release.tar.gz) or after downloading it directly from https://raw.githubusercontent.com/opengnsys/OpenGnsys/master/installer/opengnsys_installer.sh +Unpacking example: + tar xvzf opengnsys-Version.tar.gz + cd opengnsys/installer -Run opengnsys_installer.sh script as "root" to install all its dependencies, to install the OpenGnsys components, and to make the initial configuration. +Downloading examples: - sudo bash opengnsys_installer.sh + * Download with wget. + wget https://raw.githubusercontent.com/opengnsys/OpenGnsys/master/installer/opengnsys_installer.sh -Follow the instructions. + * Download with curl. + curl https://raw.githubusercontent.com/opengnsys/OpenGnsys/master/installer/opengnsys_installer.sh -o opengnsys_installer.sh -Updating OpenGnsys ------------------- +You must be root to run the installation script: + sudo bash opengnsys_installer.sh -Run opengnsys_update.sh script as "root" to update all OpenGnsys components from the Subversion repository: - sudo bash /opt/opengnsys/lib/opengnsys_update.sh +The following information will be requested in order to configure the access to the service (a default value will be introduced if no parameter is indicated): + * MySQL root password + * Web console user and OpenGnsys Super Administrator + * Web console user's password + * Client's password for accessing remote services + * Choose which ogLive clients to install. -Follow the instructions. +The following processes will be carried out: + * Gathering of the basic network parameters. + * Checking installed packages. + * Downloading and installing dependencies. + * Creating OpenGnsys basic folder sctructure. + * Downloading code from the repository to a temporal folder (/tmp/opengnsys_installer). In upcoming releases this process will not be necessary. + * Compiling and installing OpenGnsys services. + * Basic configuration of OpenGnsys network services (DHCP, PXE and Samba) using the existing configuration templates. + * Copying additional server management files. + * Creating database and configuring OpenGnsys administration console web server. + * Copying administration console pages. + * Copying OpenGnsys client folder structure. + * Downloading OpenGnsys client initial image. + * Basic configuration of OpenGnsys services using network parameters. + +Once the installation process is finished, you can start working with the system: + * Configuring DHCP. + * Adding information in the administration console. + * Customizing administration scripts. + * Creating start menus for the clients. + + + +Updating / upgrading +-------------------- +There is a system self-upgrading script with the following features: + * Network connection is needed to obtain the latest updates / upgrades. + * If the script updates itself, then it must be run once again. + * Services depending on the operating system will not be updated. + * Configuration files will not be modified. -Uninstalling OpenGnsys ----------------------- +You must be root to run this script: + sudo /opt/opengnsys/lib/opengnsys_update.sh + -Run opengnsys_uninstall.sh script as "root" to uninstall all OpenGnsys components: - sudo bash /opt/opengnsys/lib/opengnsys_uninstall.sh +Uninstalling +------------ -Follow the instructions. +There is also an uninstallation script to remove the OpenGnsys components: + * OpenGnsys files and database will be deleted. + * Operating system packages and their configuration files will be preserved. + * The image folder and its content will not be deleted. +You must be root to run this script: + sudo /opt/opengnsys/lib/opengnsys_uninstall.sh diff --git a/installer/INSTALL.es.txt b/installer/INSTALL.es.txt index 0fd5ba75..b99b1e20 100644 --- a/installer/INSTALL.es.txt +++ b/installer/INSTALL.es.txt @@ -1,54 +1,100 @@ -Instalación y Actualización de OpenGnsys 1.1.1pre -================================================= +Instalación de OpenGnsys Server 1.1.1 (Espeto) +============================================== +Notas iniciales +--------------- -Instalación inicial -------------------- +Se presupone que el servidor de OpenGnsys 1.1.1 (Espeto) debe ser instalado en una distribución del sistema operativo Ubuntu Server a partir de la versión 16.04 LTS, aunque también se está probado en sistemas basados en CentOS 7 (leer el fichero COMPATIBILITY.en.txt para obtener más detalles de compatibilidad). -1. Obtener el instalador. +El serividor debe tener acceso a Internet para descargar los paquetes necesarios, el código del proyecto y el cliente preconfigurado. -Descargar una versión completa y desccomprimir el fichero "opengnsys-version.tar.gz": - tar xvzf opengnsys-version.tar.gz - cd opengnsys/installer +Requisitos mínimos de almacenamiento: +- 100 MB en el directorio /tmp (solo durante la instalación) +- 600 MB en el directorio /var/lib/tftpboot (o /srv en sistemas Debian) por cada cliente ogLive que se desee instalar. +- 250 MB en el directorio de instalación /opt/opengnsys más 600 MB por cada imagen ISO descargada de clientes ogLive. +- Estimar la capacidad necesaria para el repositorio de imágenes en /opt/opengnsys/images (es recomendable que este directorio se monte sobre un sistema de archivos independiente). -O bien, descargar el instalador desde la última reversión del repositorio: - wget https://raw.githubusercontent.com/opengnsys/OpenGnsys/devel/installer/opengnsys_installer.sh -Opcionalmente, puede descargarse la imagen del cliente; si no se realiza este paso, el instalador la descargará automáticamente. - wget https://opengnsys.es/downloads/ogLive-versioncliente.iso +Instalación +----------- + +La instalación de OpenGnsys se realiza ejecutando el script de instalación opengnsys_installer.sh, el cual puede obtenerse descomprimiendo el fichero de la versión opengnsys-Version.tar.gz o descargándolo directamente de la dirección: https://raw.githubusercontent.com/opengnsys/OpenGnsys/devel/installer/opengnsys_installer.sh + +Ejemplos de descompresión del programa: + + tar xvzf opengnsys-Version.tar.gz + cd opengnsys/installer + +Ejemplos de descarga con varias herramientas: + + * Descargar con wget. + wget https://raw.githubusercontent.com/opengnsys/OpenGnsys/master/installer/opengnsys_installer.sh + + * Descargar con curl. + curl https://raw.githubusercontent.com/opengnsys/OpenGnsys/master/installer/opengnsys_installer.sh -o opengnsys_installer.sh + + +El script de instalación debe ser ejecutado como usuario root: + sudo bash opengnsys_installer.sh -2. Ejecutar el instalador como root: - sudo bash opengnsys_installer.sh Dicho script solicitará por teclado la siguiente información para configurar el acceso al servicio (si no se indica un parámetro, toma el valor por defecto): * Clave del usuario root de MySQL. * Usuario de acceso a la consola web y super-administrador de OpenGnsys. * Clave del usuario de acceso a la consola web. - * Clave de acceso del cliente a servicios remotos. + * Clave de acceso del cliente a servicios remotos. * Seleccionar cliente(s) ogLive para instalar. +Se realizan los siguientes procesos: + * Obtener los parámetros básicos de la red. + * Comprobar los paquetes instalados. + * Descargar e instalar las dependencias que faltan. + * Crear la estructura básica de directorios de OpenGnsys. + * Descargar el repositorio de código en un directorio temporal (/tmp/opengnsys_installer). Nota: en versiones futuras este proceso no será necesario. + * Compilar e instalar los servicios de OpenGnsys. + * Configuración básica de los serviciios de red DHCP, PXE y NFS/Samba a partir de las plantillas de configuración + * Copiar ficheros complementarios de gestión del servidor. + * Crear la base de datos y configurar el servidor web de OpenGnsys Web Admin Console. + * Copiar los ficheros de las páginas de Web Admin Console. + * Copiar la estructura de directorios de OpenGnsys Client. + * Descargar la o las imágenes iniciales de OpenGnsys Client. + * Configuración básica de los serviciios de OpenGnsys a partir de los parámetros de red. -Actaulización de ficheros -------------------------- +Una vez finalizada la ejecución del instalador, puede empezarse a trabajar con el sistema: + * Configurar DHCP. + * Añadir datos en la consola de administración. + * Personalizar scripts de administración. + * Definir menús de inicio para los clientes. -Ejecutar el script de actualización como usuario root: - sudo /opt/opengnsys/lib/opengnsys_update.sh -Notas importantes. -1. Es necesario conexión a Internet para obtener las últimas actualizaciones. -2. Si el script se actualiza a sí mismo, pedirá automáticamente que vuelva a ser ejecutado para terminar de actualizar todo el sistema. -3. El programa de actualización no modifica ficheros de configuración, no actualiza la bases de datos y no modifica ficheros de imágenes. +Actualización +------------- -Desinstalar OpenGnsys ---------------------- +Se dispone de un script de auto-actualización del sistema, con las siguientes características: + * Es necesario conexión a Internet para obtener las últimas actualizaciones. + * Si el script se actualiza a sí mismo, debe ser ejecutado de nuevo. + * No se actualizan los servicios asociados al sistema operativo. + * No se modifican los ficheros de configuración. -Ejecutar el script de actualización como usuario root: - sudo /opt/opengnsys/lib/opengnsys_uninstall.sh -Notas importantes. -1. Para poder conservar la información, es recomendable hacer copia de seguridad del servidor antes de desinstalar. -2. Se solicita confirmación por parte del usuario antes de ejecutar cualquier operación. -3. El programa de desinstalación no elimina los ficheros de imágenes, ni los clientes ogLive instalados, no desinstala ningún paquete del sistema operativo incluido en el proceso de instalación y no detiene, ni desconfigura ningún otro servicio auxiliar a OpenGnsys. +El script debe ser ejecutado como usuario root: + sudo /opt/opengnsys/lib/opengnsys_update.sh + + +Desinstalación +-------------- + +También existe un script de desinstalación de los componentes de OpenGnsys, con las siguientes características: + * Solicita confirmación para ejecutar sus operaciones. + * Se eliminan los ficheros de OpenGnsys y su base de datos. + * No se eliminan ni paquetes del sistema operativo ni sus ficheros de configuración. + * No se elimina el directorio de las imágenes ni su contenido. + * No se eliminan los clientes ogLive ni las plantillas PXE. + + +El script debe ser ejecutado como usuario root: + sudo /opt/opengnsys/lib/opengnsys_uninstall.sh + diff --git a/installer/README.en.txt b/installer/README.en.txt new file mode 100644 index 00000000..277040da --- /dev/null +++ b/installer/README.en.txt @@ -0,0 +1,25 @@ + +OpenGnsys Installer README +=============================== + + +This directory contains documentation and maintenance scripts for installing, +updating and uninstalling an OpenGnsys Server. + + +- INSTALL.en.txt installation information (English) +- INSTALL.es.txt installation information (Spanish) +- LICENSE.en.txt licence information (English) +- ogagentpkgs-Version.tar.gz agent for operationg systems (OGAgent) +- opengnsys_export.sh script to export data to another OpenGnsys Server +- opengnsys_import.sh script to import data from another OpenGnsys Server +- opengnsys_installer.sh installation script +- opengnsys_uninstall.sh uninstallation script +- opengnsys_update.sh updating script + +- opengnsys_makecompress.sh script to generate a compress file with our last release +- ogagent-devel-installer.sh script to prepare OGAgent compillation environment + +- vagrant Vagrant configuration directory to deploy some virtual + environments + diff --git a/installer/README.es.txt b/installer/README.es.txt index a7879033..0642e4ed 100644 --- a/installer/README.es.txt +++ b/installer/README.es.txt @@ -7,14 +7,18 @@ Este directorio contiene la documentación y los programas para instalar, actual eliminar el Proyecto OpenGnsys. -- INSTALL.es.txt información de instalación y desinistalación -- LICENSE.en.txt información de licencia de uso +- INSTALL.en.txt información de instalación y desinistalación (inglés) +- INSTALL.es.txt información de instalación y desinistalación (español) +- LICENSE.en.txt información de licencia de uso (inglés) +- ogagentpkgs-Version.tar.gz agentes para sistemas operativos (OGAgent) +- opengnsys_export.sh programa para exportar datos a otro servidor OpenGnsys +- opengnsys_import.sh programa para importar datos desde otro servidor OpenGnsys - opengnsys_installer.sh programa de instalación del serviidor -- opengnsys_makecompress.sh programa para descargar la última revisión del proyecto - y generar un fichero comprimido - opengnsys_uninstall.sh programa de desinstalación del serviidor - opengnsys_update.sh programa de actualización del serviidor +- opengnsys_makecompress.sh programa para descargar la última revisión del proyecto + y generar un fichero comprimido - ogagent-devel-installer.sh programa de preparación del entorno de desarrollo y compilación de agentes OGAgent para sistemas operativos diff --git a/installer/ogGenerateDoc.sh b/installer/ogGenerateDoc.sh index 62839ef2..01dbdea2 100755 --- a/installer/ogGenerateDoc.sh +++ b/installer/ogGenerateDoc.sh @@ -25,18 +25,19 @@ PROJECT=${PROJECT:-"OpenGnsys"} VERSION=$(jq '.version+" "+.codename' $(dirname "$0")/../doc/VERSION.json) 2>/dev/null VERSION=${VERSION:-"1.1.1"} cat > /tmp/doxyfile << EOF -# Doxyfile 1.5.6 -# Fichero para documentar codigo shellscripts linux. -# Proyecto OpenGnsys +# Doxyfile 1.8.13 + #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- DOXYFILE_ENCODING = UTF-8 PROJECT_NAME = $PROJECT PROJECT_NUMBER = $VERSION -OUTPUT_DIRECTORY = $2 +PROJECT_BRIEF = PROJECT_LOGO = $(dirname "$0")/../doc/opengnsys-logo.png +OUTPUT_DIRECTORY = $2 CREATE_SUBDIRS = NO +ALLOW_UNICODE_NAMES = NO OUTPUT_LANGUAGE = Spanish BRIEF_MEMBER_DESC = YES REPEAT_BRIEF = YES @@ -60,27 +61,36 @@ SHORT_NAMES = NO JAVADOC_AUTOBRIEF = NO QT_AUTOBRIEF = NO MULTILINE_CPP_IS_BRIEF = NO -DETAILS_AT_TOP = NO INHERIT_DOCS = YES SEPARATE_MEMBER_PAGES = NO -TAB_SIZE = 8 +TAB_SIZE = 4 ALIASES = +TCL_SUBST = OPTIMIZE_OUTPUT_FOR_C = YES OPTIMIZE_OUTPUT_JAVA = NO -OPTIMIZE_FOR_FORTRAN = YES +OPTIMIZE_FOR_FORTRAN = NO OPTIMIZE_OUTPUT_VHDL = NO +EXTENSION_MAPPING = lib=c +MARKDOWN_SUPPORT = YES +TOC_INCLUDE_HEADINGS = 0 +AUTOLINK_SUPPORT = YES BUILTIN_STL_SUPPORT = NO CPP_CLI_SUPPORT = NO SIP_SUPPORT = NO IDL_PROPERTY_SUPPORT = YES DISTRIBUTE_GROUP_DOC = NO +GROUP_NESTED_COMPOUNDS = NO SUBGROUPING = YES +INLINE_GROUPED_CLASSES = NO +INLINE_SIMPLE_STRUCTS = NO TYPEDEF_HIDES_STRUCT = NO +LOOKUP_CACHE_SIZE = 0 #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- EXTRACT_ALL = YES EXTRACT_PRIVATE = YES +EXTRACT_PACKAGE = NO EXTRACT_STATIC = YES EXTRACT_LOCAL_CLASSES = YES EXTRACT_LOCAL_METHODS = NO @@ -92,12 +102,17 @@ HIDE_IN_BODY_DOCS = NO INTERNAL_DOCS = NO CASE_SENSE_NAMES = YES HIDE_SCOPE_NAMES = NO +HIDE_COMPOUND_REFERENCE= NO SHOW_INCLUDE_FILES = YES +SHOW_GROUPED_MEMB_INC = NO +FORCE_LOCAL_INCLUDES = NO INLINE_INFO = YES SORT_MEMBER_DOCS = YES SORT_BRIEF_DOCS = NO +SORT_MEMBERS_CTORS_1ST = NO SORT_GROUP_NAMES = NO SORT_BY_SCOPE_NAME = NO +STRICT_PROTO_MATCHING = NO GENERATE_TODOLIST = YES GENERATE_TESTLIST = YES GENERATE_BUGLIST = YES @@ -105,22 +120,24 @@ GENERATE_DEPRECATEDLIST= YES ENABLED_SECTIONS = MAX_INITIALIZER_LINES = 30 SHOW_USED_FILES = YES -SHOW_DIRECTORIES = NO SHOW_FILES = YES SHOW_NAMESPACES = YES FILE_VERSION_FILTER = +LAYOUT_FILE = +CITE_BIB_FILES = #--------------------------------------------------------------------------- -# configuration options related to warning and progress messages +# Configuration options related to warning and progress messages #--------------------------------------------------------------------------- QUIET = NO WARNINGS = YES WARN_IF_UNDOCUMENTED = YES WARN_IF_DOC_ERROR = YES WARN_NO_PARAMDOC = NO +WARN_AS_ERROR = NO WARN_FORMAT = "$file:$line: $text" WARN_LOGFILE = #--------------------------------------------------------------------------- -# configuration options related to the input files +# Configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $1 INPUT_ENCODING = UTF-8 @@ -129,51 +146,45 @@ FILE_PATTERNS = *.c \ *.cxx \ *.cpp \ *.c++ \ - *.d \ *.java \ *.ii \ *.ixx \ *.ipp \ *.i++ \ *.inl \ + *.idl \ + *.ddl \ + *.odl \ *.h \ *.hh \ *.hxx \ *.hpp \ *.h++ \ - *.idl \ - *.odl \ *.cs \ + *.d \ *.php \ - *.php3 \ + *.php4 \ + *.php5 \ + *.phtml \ *.inc \ *.m \ + *.markdown \ + *.md \ *.mm \ *.dox \ *.py \ + *.pyw \ *.f90 \ + *.f95 \ + *.f03 \ + *.f08 \ *.f \ + *.for \ + *.tcl \ *.vhd \ *.vhdl \ - *.C \ - *.CC \ - *.C++ \ - *.II \ - *.I++ \ - *.H \ - *.HH \ - *.H++ \ - *.CS \ - *.PHP \ - *.PHP3 \ - *.M \ - *.MM \ - *.PY \ - *.F90 \ - *.F \ - *.VHD \ - *.VHDL \ - *.lib \ + *.ucf \ + *.qsf \ *.lib RECURSIVE = YES EXCLUDE = @@ -187,8 +198,10 @@ IMAGE_PATH = INPUT_FILTER = FILTER_PATTERNS = FILTER_SOURCE_FILES = NO +FILTER_SOURCE_PATTERNS = +USE_MDFILE_AS_MAINPAGE = #--------------------------------------------------------------------------- -# configuration options related to source browsing +# Configuration options related to source browsing #--------------------------------------------------------------------------- SOURCE_BROWSER = YES INLINE_SOURCES = NO @@ -196,16 +209,19 @@ STRIP_CODE_COMMENTS = YES REFERENCED_BY_RELATION = YES REFERENCES_RELATION = YES REFERENCES_LINK_SOURCE = YES +SOURCE_TOOLTIPS = YES USE_HTAGS = NO VERBATIM_HEADERS = YES +CLANG_ASSISTED_PARSING = NO +CLANG_OPTIONS = #--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index +# Configuration options related to the alphabetical class index #--------------------------------------------------------------------------- -ALPHABETICAL_INDEX = NO +ALPHABETICAL_INDEX = YES COLS_IN_ALPHA_INDEX = 5 IGNORE_PREFIX = #--------------------------------------------------------------------------- -# configuration options related to the HTML output +# Configuration options related to the HTML output #--------------------------------------------------------------------------- GENERATE_HTML = YES HTML_OUTPUT = html @@ -213,68 +229,112 @@ HTML_FILE_EXTENSION = .html HTML_HEADER = HTML_FOOTER = HTML_STYLESHEET = -HTML_ALIGN_MEMBERS = YES -GENERATE_HTMLHELP = NO +HTML_EXTRA_STYLESHEET = +HTML_EXTRA_FILES = +HTML_COLORSTYLE_HUE = 220 +HTML_COLORSTYLE_SAT = 100 +HTML_COLORSTYLE_GAMMA = 80 +HTML_TIMESTAMP = NO +HTML_DYNAMIC_SECTIONS = NO +HTML_INDEX_NUM_ENTRIES = 100 GENERATE_DOCSET = NO DOCSET_FEEDNAME = "Doxygen generated docs" DOCSET_BUNDLE_ID = org.doxygen.Project -HTML_DYNAMIC_SECTIONS = NO +DOCSET_PUBLISHER_ID = org.doxygen.Publisher +DOCSET_PUBLISHER_NAME = Publisher +GENERATE_HTMLHELP = NO CHM_FILE = HHC_LOCATION = GENERATE_CHI = NO CHM_INDEX_ENCODING = BINARY_TOC = NO TOC_EXPAND = NO +GENERATE_QHP = NO +QCH_FILE = +QHP_NAMESPACE = org.doxygen.Project +QHP_VIRTUAL_FOLDER = doc +QHP_CUST_FILTER_NAME = +QHP_CUST_FILTER_ATTRS = +QHP_SECT_FILTER_ATTRS = +QHG_LOCATION = +GENERATE_ECLIPSEHELP = NO +ECLIPSE_DOC_ID = org.doxygen.Project DISABLE_INDEX = NO +GENERATE_TREEVIEW = NO ENUM_VALUES_PER_LINE = 4 -GENERATE_TREEVIEW = ALL TREEVIEW_WIDTH = 250 +EXT_LINKS_IN_WINDOW = NO FORMULA_FONTSIZE = 10 -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output +FORMULA_TRANSPARENT = YES +USE_MATHJAX = NO +MATHJAX_FORMAT = HTML-CSS +MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest +MATHJAX_EXTENSIONS = +MATHJAX_CODEFILE = +SEARCHENGINE = YES +SERVER_BASED_SEARCH = NO +EXTERNAL_SEARCH = NO +SEARCHENGINE_URL = +SEARCHDATA_FILE = searchdata.xml +EXTERNAL_SEARCH_ID = +EXTRA_SEARCH_MAPPINGS = +#--------------------------------------------------------------------------- +# Configuration options related to the LaTeX output #--------------------------------------------------------------------------- GENERATE_LATEX = NO LATEX_OUTPUT = latex LATEX_CMD_NAME = latex MAKEINDEX_CMD_NAME = makeindex COMPACT_LATEX = NO -PAPER_TYPE = a4wide +PAPER_TYPE = a4 EXTRA_PACKAGES = LATEX_HEADER = +LATEX_FOOTER = +LATEX_EXTRA_STYLESHEET = +LATEX_EXTRA_FILES = PDF_HYPERLINKS = YES USE_PDFLATEX = YES LATEX_BATCHMODE = NO LATEX_HIDE_INDICES = NO +LATEX_SOURCE_CODE = NO +LATEX_BIB_STYLE = plain +LATEX_TIMESTAMP = NO #--------------------------------------------------------------------------- -# configuration options related to the RTF output +# Configuration options related to the RTF output #--------------------------------------------------------------------------- GENERATE_RTF = NO RTF_OUTPUT = rtf -COMPACT_RTF = YES -RTF_HYPERLINKS = YES +COMPACT_RTF = NO +RTF_HYPERLINKS = NO RTF_STYLESHEET_FILE = RTF_EXTENSIONS_FILE = +RTF_SOURCE_CODE = NO #--------------------------------------------------------------------------- -# configuration options related to the man page output +# Configuration options related to the man page output #--------------------------------------------------------------------------- GENERATE_MAN = NO MAN_OUTPUT = man MAN_EXTENSION = .3 -MAN_LINKS = YES +MAN_SUBDIR = +MAN_LINKS = NO #--------------------------------------------------------------------------- -# configuration options related to the XML output +# Configuration options related to the XML output #--------------------------------------------------------------------------- GENERATE_XML = NO XML_OUTPUT = xml -XML_SCHEMA = -XML_DTD = XML_PROGRAMLISTING = YES #--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output +# Configuration options related to the DOCBOOK output +#--------------------------------------------------------------------------- +GENERATE_DOCBOOK = NO +DOCBOOK_OUTPUT = docbook +DOCBOOK_PROGRAMLISTING = NO +#--------------------------------------------------------------------------- +# Configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- GENERATE_AUTOGEN_DEF = NO #--------------------------------------------------------------------------- -# configuration options related to the Perl module output +# Configuration options related to the Perl module output #--------------------------------------------------------------------------- GENERATE_PERLMOD = NO PERLMOD_LATEX = NO @@ -284,7 +344,7 @@ PERLMOD_MAKEVAR_PREFIX = # Configuration options related to the preprocessor #--------------------------------------------------------------------------- ENABLE_PREPROCESSING = YES -MACRO_EXPANSION = YES +MACRO_EXPANSION = NO EXPAND_ONLY_PREDEF = NO SEARCH_INCLUDES = YES INCLUDE_PATH = @@ -293,26 +353,31 @@ PREDEFINED = EXPAND_AS_DEFINED = SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- -# Configuration::additions related to external references +# Configuration options related to external references #--------------------------------------------------------------------------- TAGFILES = GENERATE_TAGFILE = ALLEXTERNALS = NO EXTERNAL_GROUPS = YES +EXTERNAL_PAGES = YES PERL_PATH = /usr/bin/perl #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- -CLASS_DIAGRAMS = NO +CLASS_DIAGRAMS = YES MSCGEN_PATH = +DIA_PATH = HIDE_UNDOC_RELATIONS = YES HAVE_DOT = YES +DOT_NUM_THREADS = 0 DOT_FONTNAME = FreeSans +DOT_FONTSIZE = 10 DOT_FONTPATH = CLASS_GRAPH = YES COLLABORATION_GRAPH = YES GROUP_GRAPHS = YES UML_LOOK = NO +UML_LIMIT_NUM_FIELDS = 10 TEMPLATE_RELATIONS = NO INCLUDE_GRAPH = YES INCLUDED_BY_GRAPH = YES @@ -321,18 +386,20 @@ CALLER_GRAPH = NO GRAPHICAL_HIERARCHY = YES DIRECTORY_GRAPH = YES DOT_IMAGE_FORMAT = png +INTERACTIVE_SVG = NO DOT_PATH = DOTFILE_DIRS = -DOT_GRAPH_MAX_NODES = 20 -MAX_DOT_GRAPH_DEPTH = 2 -DOT_TRANSPARENT = YES +MSCFILE_DIRS = +DIAFILE_DIRS = +PLANTUML_JAR_PATH = +PLANTUML_CFG_FILE = +PLANTUML_INCLUDE_PATH = +DOT_GRAPH_MAX_NODES = 50 +MAX_DOT_GRAPH_DEPTH = 0 +DOT_TRANSPARENT = NO DOT_MULTI_TARGETS = NO GENERATE_LEGEND = YES DOT_CLEANUP = YES -#--------------------------------------------------------------------------- -# Configuration::additions related to the search engine -#--------------------------------------------------------------------------- -SEARCHENGINE = NO EOF doxygen /tmp/doxyfile diff --git a/installer/opengnsys_installer.sh b/installer/opengnsys_installer.sh index c5375050..883ef19e 100755 --- a/installer/opengnsys_installer.sh +++ b/installer/opengnsys_installer.sh @@ -141,8 +141,9 @@ OPENGNSYS_DB_CREATION_FILE=opengnsys/admin/Database/${OPENGNSYS_DATABASE}.sql # - STARTSERVICE, ENABLESERVICE - iniciar y habilitar un servicio # - STOPSERVICE, DISABLESERVICE - parar y deshabilitar un servicio # - APACHESERV, APACHECFGDIR, APACHESITESDIR, APACHEUSER, APACHEGROUP - servicio y configuración de Apache -# - APACHESSLMOD, APACHEENABLESSL, APACHEMAKECERT - habilitar módulo Apache y certificado SSL +# - APACHEENABLEMODS, APACHEENABLESSL, APACHEMAKECERT - habilitar módulos y certificado SSL # - APACHEENABLEOG, APACHEOGSITE, - habilitar sitio web de OpenGnsys +# - PHPFPMSERV - servicio PHP FastCGI Process Manager para Apache # - INETDSERV - servicio Inetd # - FIREWALLSERV - servicio de cortabuegos IPTables/FirewallD # - DHCPSERV, DHCPCFGDIR - servicio y configuración de DHCP @@ -169,7 +170,7 @@ OSVERSION="${OSVERSION%%.*}" # Configuración según la distribución GNU/Linux (usar minúsculas). case "$OSDISTRIB" in ubuntu|debian|linuxmint) - DEPENDENCIES=( subversion apache2 php php-ldap libapache2-mod-php mysql-server php-mysql isc-dhcp-server bittorrent tftp-hpa tftpd-hpa xinetd build-essential g++-multilib libmysqlclient-dev wget curl doxygen graphviz bittornado ctorrent samba rsync unzip netpipes debootstrap schroot squashfs-tools btrfs-tools procps arp-scan realpath php-curl gettext moreutils jq wakeonlan udpcast shim-signed grub-efi-amd64-signed ) + DEPENDENCIES=( subversion apache2 php php-ldap php-fpm mysql-server php-mysql isc-dhcp-server bittorrent tftp-hpa tftpd-hpa xinetd build-essential g++-multilib libmysqlclient-dev wget curl doxygen graphviz bittornado ctorrent samba rsync unzip netpipes debootstrap schroot squashfs-tools btrfs-tools procps arp-scan realpath php-curl gettext moreutils jq wakeonlan udpcast shim-signed grub-efi-amd64-signed ) UPDATEPKGLIST="apt-get update" INSTALLPKG="apt-get -y install --force-yes" CHECKPKG="dpkg -s \$package 2>/dev/null | grep Status | grep -qw install" @@ -188,8 +189,7 @@ case "$OSDISTRIB" in APACHEOGSITE=opengnsys APACHEUSER="www-data" APACHEGROUP="www-data" - APACHESSLMOD="a2enmod ssl" - APACHEREWRITEMOD="a2enmod rewrite" + APACHEENABLEMODS="a2enmod ssl rewrite proxy_fcgi fastcgi actions alias" APACHEENABLESSL="a2ensite default-ssl" APACHEENABLEOG="a2ensite $APACHEOGSITE" APACHEMAKECERT="make-ssl-cert generate-default-snakeoil --force-overwrite" @@ -199,6 +199,7 @@ case "$OSDISTRIB" in INETDCFGDIR=/etc/xinetd.d MYSQLSERV=mysql MARIADBSERV=mariadb + PHPFPMSERV=php-fpm RSYNCSERV=rsync RSYNCCFGDIR=/etc SAMBASERV=smbd @@ -206,8 +207,9 @@ case "$OSDISTRIB" in TFTPCFGDIR=/var/lib/tftpboot ;; fedora|centos) - DEPENDENCIES=( subversion httpd mod_ssl php php-ldap mysql-server mysql-devel mysql-devel.i686 php-mysql dhcp tftp-server tftp xinetd binutils gcc gcc-c++ glibc-devel glibc-devel.i686 glibc-static glibc-static.i686 libstdc++-devel.i686 make wget curl doxygen graphviz ctorrent samba samba-client rsync unzip debootstrap schroot squashfs-tools python-crypto arp-scan procps-ng gettext moreutils jq net-tools http://ftp.altlinux.org/pub/distributions/ALTLinux/5.1/branch/$(arch)/RPMS.classic/netpipes-4.2-alt1.$(arch).rpm ) - INSTALLEXTRADEPS=( 'pushd /tmp; wget -t3 http://download.bittornado.com/download/BitTornado-0.3.18.tar.gz && tar xvzf BitTornado-0.3.18.tar.gz && cd BitTornado-CVS && python setup.py install && ln -fs btlaunchmany.py /usr/bin/btlaunchmany && ln -fs bttrack.py /usr/bin/bttrack; popd' ) + DEPENDENCIES=( subversion httpd mod_ssl php-ldap php-fpm mysql-server mysql-devel mysql-devel.i686 php-mysql dhcp tftp-server tftp xinetd binutils gcc gcc-c++ glibc-devel glibc-devel.i686 glibc-static glibc-static.i686 libstdc++-devel.i686 make wget curl doxygen graphviz ctorrent samba samba-client rsync unzip debootstrap schroot squashfs-tools python-crypto arp-scan procps-ng gettext moreutils jq net-tools udpcast shim-x64 grub2-efi-x64 grub2-efi-x64-modules http://ftp.altlinux.org/pub/distributions/ALTLinux/5.1/branch/$(arch)/RPMS.classic/netpipes-4.2-alt1.$(arch).rpm ) + [ "$OSDISTRIB" == "centos" ] && UPDATEPKGLIST="yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-$OSVERSION.noarch.rpm http://rpms.remirepo.net/enterprise/remi-release-$OSVERSION.rpm" + INSTALLEXTRADEPS=( 'pushd /tmp; wget -t3 http://ftp.acc.umu.se/mirror/bittornado/BitTornado-0.3.18.tar.gz && tar xvzf BitTornado-0.3.18.tar.gz && cd BitTornado-CVS && python setup.py install && ln -fs btlaunchmany.py /usr/bin/btlaunchmany && ln -fs bttrack.py /usr/bin/bttrack; popd' ) INSTALLPKG="yum install -y libstdc++ libstdc++.i686" CHECKPKG="rpm -q --quiet \$package" SYSTEMD=$(which systemctl 2>/dev/null) @@ -239,6 +241,7 @@ case "$OSDISTRIB" in INETDCFGDIR=/etc/xinetd.d MYSQLSERV=mysqld MARIADBSERV=mariadb + PHPFPMSERV=php-fpm RSYNCSERV=rsync RSYNCCFGDIR=/etc SAMBASERV=smb @@ -302,20 +305,19 @@ case "$OSDISTRIB" in add-apt-repository -y ppa:ondrej/php eval $UPDATEPKGLIST PHP7VERSION=$(apt-cache pkgnames php7 | sort | head -1) + PHPFPMSERV="${PHP7VERSION}-fpm" DEPENDENCIES=( ${DEPENDENCIES[@]//php/$PHP7VERSION} ) fi # Adaptar dependencias para libmysqlclient. [ -z "$(apt-cache pkgnames libmysqlclient-dev)" ] && [ -n "$(apt-cache pkgnames libmysqlclient15)" ] && DEPENDENCIES=( ${DEPENDENCIES[@]//libmysqlclient-dev/libmysqlclient15} ) + # Paquete correcto para realpath. + [ -z "$(apt-cache pkgnames realpath)" ] && DEPENDENCIES=( ${DEPENDENCIES[@]//realpath/coreutils} ) ;; centos) # Postconfiguación personalizada para CentOS. # Configuración para PHP 7. - if ! yum list php7 &>/dev/null; then - if [ $OSVERSION -lt 7 ]; then - yum install -y https://mirror.webtatic.com/yum/el$OSVERSION/latest.rpm - PHP7VERSION=$(yum list -q php7\*w | awk -F. '/^php/ {p=$1} END {print p}') - DEPENDENCIES=( ${DEPENDENCIES[@]//php/$PHP5VERSION} ) - fi - fi + PHP7VERSION=$(yum list -q php7\* 2>/dev/null | awk -F. '/^php/ {print $1; exit;}') + PHPFPMSERV="${PHP7VERSION}-${PHPFPMSERV}" + DEPENDENCIES=( ${PHP7VERSION} ${DEPENDENCIES[@]//php/$PHP7VERSION-php} ) # Cambios a aplicar a partir de CentOS 7. if [ $OSVERSION -ge 7 ]; then # Sustituir MySQL por MariaDB. @@ -876,8 +878,8 @@ function getNetworkSettings() if [ -n "${SERVERIP[i]}" ]; then NETMASK[i]=$( cidr2mask $(ip -o addr show dev "$dev" | awk '$3~/inet$/ {sub (/.*\//, "", $4); print ($4)}') ) NETBROAD[i]=$(ip -o addr show dev "$dev" | awk '$3~/inet$/ {print ($6)}') - NETIP[i]=$(ip route | awk -v d="$dev" '$3==d && /src/ {sub (/\/.*/,""); print $1}') - ROUTERIP[i]=$(ip route | awk -v d="$dev" '$1=="default" && $5==d {print $3}') + NETIP[i]=$(ip route list proto kernel | awk -v d="$dev" '$3==d && /src/ {sub (/\/.*/,""); print $1}') + ROUTERIP[i]=$(ip route list default | awk -v d="$dev" '$5==d {print $3}') DEFAULTDEV=${DEFAULTDEV:-"$dev"} fi let i++ @@ -1087,12 +1089,10 @@ function installWebFiles() sed 's/clickcontextualnodo/clicksupnodo/g' $COMPATDIR/$f.php > $COMPATDIR/$f.device.php done cp -a $COMPATDIR/imagenes.device.php $COMPATDIR/imagenes.device4.php - # Cambiar permisos para ficheros especiales. - chown -R $APACHE_RUN_USER:$APACHE_RUN_GROUP $INSTALL_TARGET/www/images/{fotos,iconos} - chown -R $APACHE_RUN_USER:$APACHE_RUN_GROUP $INSTALL_TARGET/www/tmp/ + # Acceso al manual de usuario + ln -fs ../doc/userManual $INSTALL_TARGET/www/userManual # Ficheros de log de la API REST. touch $INSTALL_TARGET/log/{ogagent,remotepc,rest}.log - chown -R $APACHE_RUN_USER:$APACHE_RUN_GROUP $INSTALL_TARGET/log/{ogagent,remotepc,rest}.log echoAndLog "${FUNCNAME}(): Web files installed successfully." } @@ -1136,6 +1136,7 @@ function installWebConsoleApacheConf() local path_opengnsys_base="$1" local path_apache2_confd="$2" local CONSOLEDIR=${path_opengnsys_base}/www + local sockfile if [ ! -d $path_apache2_confd ]; then errorAndLog "${FUNCNAME}(): path to apache2 conf.d can not found, verify your server installation" @@ -1146,12 +1147,17 @@ function installWebConsoleApacheConf() echoAndLog "${FUNCNAME}(): creating apache2 config file.." + # Avtivar PHP-FPM. + echoAndLog "${FUNCNAME}(): configuring PHP-FPM" + service=$PHPFPMSERV + $ENABLESERVICE; $STARTSERVICE + sockfile=$(find /run/php -name "php*.sock" -type s -print 2>/dev/null) + + # Activar módulos de Apache. + $APACHEENABLEMODS # Activar HTTPS. - $APACHESSLMOD $APACHEENABLESSL $APACHEMAKECERT - # Activar módulo Rewrite. - $APACHEREWRITEMOD # Genera configuración de consola web a partir del fichero plantilla. if [ -n "$(apachectl -v | grep "2\.[0-2]")" ]; then # Configuración para versiones anteriores de Apache. @@ -1159,8 +1165,14 @@ function installWebConsoleApacheConf() $WORKDIR/opengnsys/server/etc/apache-prev2.4.conf.tmpl > $path_apache2_confd/$APACHESITESDIR/${APACHEOGSITE} else # Configuración específica a partir de Apache 2.4 - sed -e "s,CONSOLEDIR,$CONSOLEDIR,g" \ - $WORKDIR/opengnsys/server/etc/apache.conf.tmpl > $path_apache2_confd/$APACHESITESDIR/${APACHEOGSITE}.conf + if [ -n "$sockfile" ]; then + sed -e "s,CONSOLEDIR,$CONSOLEDIR,g" \ + -e "s,proxy:fcgi:.*,proxy:unix:${sockfile%% *}|fcgi://localhost\",g" \ + $WORKDIR/opengnsys/server/etc/apache.conf.tmpl > $path_apache2_confd/$APACHESITESDIR/${APACHEOGSITE}.conf + else + sed -e "s,CONSOLEDIR,$CONSOLEDIR,g" \ + $WORKDIR/opengnsys/server/etc/apache.conf.tmpl > $path_apache2_confd/$APACHESITESDIR/${APACHEOGSITE}.conf + fi fi $APACHEENABLEOG if [ $? -ne 0 ]; then @@ -1185,7 +1197,6 @@ function makeDoxygenFiles() return 1 fi mv "$INSTALL_TARGET/www/html" "$INSTALL_TARGET/www/api" - chown -R $APACHE_RUN_USER:$APACHE_RUN_GROUP $INSTALL_TARGET/www/api echoAndLog "${FUNCNAME}(): Doxygen web files created successfully." } @@ -1233,15 +1244,6 @@ function createDirs() fi fi - # Establecer los permisos básicos. - echoAndLog "${FUNCNAME}(): setting directory permissions" - chmod -R 775 $path_opengnsys_base/{log/clients,images} - chown -R :$OPENGNSYS_CLIENT_USER $path_opengnsys_base/{log/clients,images} - if [ $? -ne 0 ]; then - errorAndLog "${FUNCNAME}(): error while setting permissions" - return 1 - fi - # Mover el fichero de registro de instalación al directorio de logs. echoAndLog "${FUNCNAME}(): moving installation log file" mv $LOG_FILE $OGLOGFILE && LOG_FILE=$OGLOGFILE @@ -1332,15 +1334,6 @@ function servicesCompilation () hayErrores=1 fi popd - # Compilar OpenGnsys Repository Manager - echoAndLog "${FUNCNAME}(): Compiling OpenGnsys Repository Manager" - pushd $WORKDIR/opengnsys/admin/Sources/Services/ogAdmRepo - make && mv ogAdmRepo $INSTALL_TARGET/sbin - if [ $? -ne 0 ]; then - echoAndLog "${FUNCNAME}(): error while compiling OpenGnsys Repository Manager" - hayErrores=1 - fi - popd # Compilar OpenGnsys Agent echoAndLog "${FUNCNAME}(): Compiling OpenGnsys Agent" pushd $WORKDIR/opengnsys/admin/Sources/Services/ogAdmAgent @@ -1475,9 +1468,12 @@ function openGnsysConfigure() echo "* * * * * root [ -x $INSTALL_TARGET/bin/deletepreimage ] && $INSTALL_TARGET/bin/deletepreimage" > /etc/cron.d/imagedelete echo "* * * * * root [ -x $INSTALL_TARGET/bin/ogagentqueue.cron ] && $INSTALL_TARGET/bin/ogagentqueue.cron" > /etc/cron.d/ogagentqueue - echoAndLog "${FUNCNAME}(): Creating logrotate configuration file." + echoAndLog "${FUNCNAME}(): Creating logrotate configuration files." + sed -e "s/OPENGNSYSDIR/${INSTALL_TARGET//\//\\/}/g" \ + $WORKDIR/opengnsys/server/etc/logrotate.tmpl > /etc/logrotate.d/opengnsysServer + sed -e "s/OPENGNSYSDIR/${INSTALL_TARGET//\//\\/}/g" \ - $WORKDIR/opengnsys/server/etc/logrotate.tmpl > /etc/logrotate.d/opengnsys + $WORKDIR/opengnsys/repoman/etc/logrotate.tmpl > /etc/logrotate.d/opengnsysRepo echoAndLog "${FUNCNAME}(): Creating OpenGnsys config files." for dev in ${DEVICE[*]}; do @@ -1489,7 +1485,7 @@ function openGnsysConfigure() $WORKDIR/opengnsys/admin/Sources/Services/ogAdmServer/ogAdmServer.cfg > $INSTALL_TARGET/etc/ogAdmServer-$dev.cfg sed -e "s/SERVERIP/${SERVERIP[i]}/g" \ -e "s/REPOKEY/$OPENGNSYS_REPOKEY/g" \ - $WORKDIR/opengnsys/admin/Sources/Services/ogAdmRepo/ogAdmRepo.cfg > $INSTALL_TARGET/etc/ogAdmRepo-$dev.cfg + $WORKDIR/opengnsys/repoman/etc/ogAdmRepo.cfg.tmpl > $INSTALL_TARGET/etc/ogAdmRepo-$dev.cfg sed -e "s/SERVERIP/${SERVERIP[i]}/g" \ -e "s/DBUSER/$OPENGNSYS_DB_USER/g" \ -e "s/DBPASSWORD/$OPENGNSYS_DB_PASSWD/g" \ diff --git a/installer/opengnsys_uninstall.sh b/installer/opengnsys_uninstall.sh index a9cde989..264ef71e 100755 --- a/installer/opengnsys_uninstall.sh +++ b/installer/opengnsys_uninstall.sh @@ -115,6 +115,7 @@ for dir in $OPENGNSYS/*; do done rm -f /etc/init.d/opengnsys /etc/default/opengnsys /var/log/opengnsys rm -f /etc/cron.d/{opengnsys,torrentcreator,torrenttracker} +rm -f /etc/logrotate.d/opengnsys* # Elminar recursos de OpenGnsys en Samba. rm -f /etc/samba/smb-og.conf perl -ni -e "print unless /smb-og.conf/" /etc/samba/smb.conf diff --git a/installer/opengnsys_update.sh b/installer/opengnsys_update.sh index be36d643..a522434a 100755 --- a/installer/opengnsys_update.sh +++ b/installer/opengnsys_update.sh @@ -96,7 +96,8 @@ LOG_FILE=/tmp/$(basename $OGLOGFILE) # - OSDISTRIB - distribución Linux # - DEPENDENCIES - array de dependencias que deben estar instaladas # - UPDATEPKGLIST, INSTALLPKGS, CHECKPKG - comandos para gestión de paquetes -# - APACHECFGDIR, APACHESERV, DHCPSERV, INETDCFGDIR - configuración y servicios +# - APACHECFGDIR, APACHESERV, PHPFPMSERV, DHCPSERV, INETDCFGDIR - configuración y servicios + function autoConfigure() { local service @@ -117,7 +118,7 @@ function autoConfigure() # Configuración según la distribución de Linux. if [ -f /etc/debian_version ]; then # Distribución basada en paquetes Deb. - DEPENDENCIES=( curl rsync btrfs-tools procps arp-scan realpath php-curl gettext moreutils jq wakeonlan udpcast ) + DEPENDENCIES=( curl rsync btrfs-tools procps arp-scan realpath php-curl gettext moreutils jq wakeonlan udpcast shim-signed grub-efi-amd64-signed php-fpm ) UPDATEPKGLIST="add-apt-repository -y ppa:ondrej/php; apt-get update" INSTALLPKGS="apt-get -y install" DELETEPKGS="apt-get -y purge" @@ -132,14 +133,17 @@ function autoConfigure() SERVICESTATUS="eval /etc/init.d/\$service status" fi ENABLESERVICE="eval update-rc.d \$service defaults" + APACHEENABLEMODS="ssl rewrite proxy_fcgi fastcgi actions alias" + APACHEDISABLEMODS="php" APACHEUSER="www-data" APACHEGROUP="www-data" + PHPFPMSERV="php-fpm" INETDCFGDIR=/etc/xinetd.d elif [ -f /etc/redhat-release ]; then # Distribución basada en paquetes rpm. - DEPENDENCIES=( curl rsync btrfs-progs procps-ng arp-scan gettext moreutils jq net-tools ) - # En CentOS 7 instalar arp-scan de CentOS 6. - [ "$OSDISTRIB$OSVERSION" == "centos7" ] && DEPENDENCIES=( ${DEPENDENCIES[*]/arp-scan/http://dag.wieers.com/redhat/el6/en/$(arch)/dag/RPMS/arp-scan-1.9-1.el6.rf.$(arch).rpm} ) + DEPENDENCIES=( curl rsync btrfs-progs procps-ng arp-scan gettext moreutils jq net-tools udpcast shim-x64 grub2-efi-x64 grub2-efi-x64-modules ) + # Repositorios para PHP 7 en CentOS. + [ "$OSDISTRIB" == "centos" ] && UPDATEPKGLIST="yum update -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-$OSVERSION.noarch.rpm http://rpms.remirepo.net/enterprise/remi-release-$OSVERSION.rpm" INSTALLPKGS="yum install -y" DELETEPKGS="yum remove -y" CHECKPKG="rpm -q --quiet \$package" @@ -156,6 +160,7 @@ function autoConfigure() fi APACHEUSER="apache" APACHEGROUP="apache" + PHPFPMSERV="php-fpm" INETDCFGDIR=/etc/xinetd.d else # Otras distribuciones. @@ -370,13 +375,24 @@ function installDependencies() if [ -f /etc/debian_version ]; then # Basado en paquetes Deb. PHP7VERSION=$(apt-cache pkgnames php7 2>/dev/null | sort | head -1) - PHP5PKGS=( $(dpkg -l |awk '$2~/^php5/ {print $2}') ) + PHPFPMSERV="${PHP7VERSION}-fpm" + PHP5PKGS=( $(dpkg -l | awk '$2~/^php5/ {print $2}') ) if [ -n "$PHP5PKGS" ]; then $DELETEPKGS ${PHP5PKGS[@]} - PHP5PKGS[0]=$PHP7VERSION + PHP5PKGS[0]="$PHP7VERSION" INSTALLDEPS=${PHP5PKGS[@]//php5*-/${PHP7VERSION}-} fi fi + if [ "$OSDISTRIB" == "centos" ]; then + PHP7VERSION=$(yum list -q php7\* 2>/dev/null | awk -F. '/^php/ {print $1; exit;}') + PHPFPMSERV="${PHP7VERSION}-${PHPFPMSERV}" + PHP5PKGS=( $(yum list installed | awk '$1~/^php/ && $2~/^5\./ {sub(/\..*$/, "", $1); print $1}') ) + if [ -n "$PHP5PKGS" ]; then + $DELETEPKGS ${PHP5PKGS[@]} + PHP5PKGS[0]="$PHP7VERSION-php" + INSTALLDEPS=${PHP5PKGS[@]//php-/${PHP7VERSION}-php} + fi + fi if [ $# = 0 ]; then echoAndLog "${FUNCNAME}(): no dependencies are needed" @@ -529,33 +545,44 @@ EOT # Configurar HTTPS y exportar usuario y grupo del servicio Apache. function apacheConfiguration () { - local config template + local config template module socketfile - # Activar HTTPS (solo actualizando desde versiones anteriores a 1.0.2) y - # activar módulo Rewrite (solo actualizaciones desde 1.0.x a 1.1.x). + # Avtivar PHP-FPM. + echoAndLog "${FUNCNAME}(): configuring PHP-FPM" + service=$PHPFPMSERV + $ENABLESERVICE; $STARTSERVICE + + # Activar módulos de Apache. if [ -e $APACHECFGDIR/sites-available/opengnsys.conf ]; then echoAndLog "${FUNCNAME}(): Configuring Apache modules" a2ensite default-ssl - a2enmod ssl - a2enmod rewrite + for module in $APACHEENABLEMODS; do a2enmod -q "$module"; done + for module in $APACHEDISABLEMODS; do a2dismod -q "${module//PHP7VERSION}"; done a2ensite opengnsys elif [ -e $APACHECFGDIR/conf.modules.d ]; then echoAndLog "${FUNCNAME}(): Configuring Apache modules" sed -i '/rewrite/s/^#//' $APACHECFGDIR/*.conf fi + # Elegir plantilla según versión de Apache. + if [ -n "$(apachectl -v | grep "2\.[0-2]")" ]; then + template=$WORKDIR/opengnsys/server/etc/apache-prev2.4.conf.tmpl > $config + else + template=$WORKDIR/opengnsys/server/etc/apache.conf.tmpl + fi + sockfile=$(find /run/php -name "php*.sock" -type s -print 2>/dev/null) # Actualizar configuración de Apache a partir de fichero de plantilla. for config in $APACHECFGDIR/{,sites-available/}opengnsys.conf; do - # Elegir plantilla según versión de Apache. - if [ -n "$(apachectl -v | grep "2\.[0-2]")" ]; then - template=$WORKDIR/opengnsys/server/etc/apache-prev2.4.conf.tmpl > $config - else - template=$WORKDIR/opengnsys/server/etc/apache.conf.tmpl + if [ -e $config ]; then + if [ -n "$sockfile" ]; then + sed -e "s,CONSOLEDIR,$INSTALL_TARGET/www,g; s,proxy:fcgi:.*,proxy:unix:${sockfile%% *}|fcgi://localhost\",g" $template > $config + else + sed -e "s,CONSOLEDIR,$INSTALL_TARGET/www,g" $template > $config + fi fi - sed -e "s,CONSOLEDIR,$INSTALL_TARGET/www,g" $template > $config done # Reiniciar Apache. - service=$APACHESERV; $STARTSERCICE + service=$APACHESERV; $STARTSERVICE # Variables de ejecución de Apache. # - APACHE_RUN_USER @@ -641,10 +668,10 @@ function updateWebFiles() sed 's/clickcontextualnodo/clicksupnodo/g' $COMPATDIR/$f.php > $COMPATDIR/$f.device.php done cp -a $COMPATDIR/imagenes.device.php $COMPATDIR/imagenes.device4.php - + # Acceso al manual de usuario + ln -fs ../doc/userManual $INSTALL_TARGET/www/userManual # Fichero de log de la API REST. touch $INSTALL_TARGET/log/{ogagent,rest,remotepc}.log - chown -R $APACHE_RUN_USER:$APACHE_RUN_GROUP $INSTALL_TARGET/log/{ogagent,rest,remotepc}.log echoAndLog "${FUNCNAME}(): Web files successfully updated" } @@ -915,16 +942,8 @@ function compileServices() hayErrores=1 fi popd - # Compilar OpenGnsys Repository Manager - echoAndLog "${FUNCNAME}(): Recompiling OpenGnsys Repository Manager" - pushd $WORKDIR/opengnsys/admin/Sources/Services/ogAdmRepo - make && moveNewService ogAdmRepo $INSTALL_TARGET/sbin - if [ $? -ne 0 ]; then - echoAndLog "${FUNCNAME}(): error while compiling OpenGnsys Repository Manager" - hayErrores=1 - fi - popd - # Actualizar o insertar clave de acceso REST en el fichero de configuración del repositorio. + # Parar antiguo servicio de repositorio y añadir clave de acceso REST en su fichero de configuración. + pgrep ogAdmRepo > /dev/null && service="ogAdmRepo" $STOPSERVICE grep -q '^ApiToken=' $INSTALL_TARGET/etc/ogAdmRepo.cfg && \ sed -i "s/^ApiToken=.*$/ApiToken=$REPOKEY/" $INSTALL_TARGET/etc/ogAdmRepo.cfg || \ sed -i "$ a\ApiToken=$REPOKEY/" $INSTALL_TARGET/etc/ogAdmRepo.cfg @@ -1012,17 +1031,32 @@ function updateClient() # Comprobar permisos y ficheros. function checkFiles() { + local LOGROTATEDIR=/etc/logrotate.d + # Comprobar permisos adecuados. if [ -x $INSTALL_TARGET/bin/checkperms ]; then echoAndLog "${FUNCNAME}(): Checking permissions" OPENGNSYS_DIR="$INSTALL_TARGET" OPENGNSYS_USER="$OPENGNSYS_CLIENTUSER" APACHE_USER="$APACHE_RUN_USER" APACHE_GROUP="$APACHE_RUN_GROUP" $INSTALL_TARGET/bin/checkperms fi - # Eliminamos el fichero de estado del tracker porque es incompatible entre los distintos paquetes if [ -f /tmp/dstate ]; then echoAndLog "${FUNCNAME}(): Deleting unused files" rm -f /tmp/dstate fi + # Crear nuevos ficheros de logrotate y borrar el fichero antiguo. + if [ -d $LOGROTATEDIR ]; then + rm -f $LOGROTATEDIR/opengnsys + if [ ! -f $LOGROTATEDIR/opengnsysServer ]; then + echoAndLog "${FUNCNAME}(): Creating logrotate configuration file for server" + sed -e "s/OPENGNSYSDIR/${INSTALL_TARGET//\//\\/}/g" \ + $WORKDIR/opengnsys/server/etc/logrotate.tmpl > $LOGROTATEDIR/opengnsysServer + fi + if [ ! -f $LOGROTATEDIR/opengnsysRepo ]; then + echoAndLog "${FUNCNAME}(): Creating logrotate configuration file for repository" + sed -e "s/OPENGNSYSDIR/${INSTALL_TARGET//\//\\/}/g" \ + $WORKDIR/opengnsys/server/etc/logrotate.tmpl > $LOGROTATEDIR/opengnsysRepo + fi + fi } # Resumen de actualización. diff --git a/installer/vagrant/Vagrantfile-boottools-vbox b/installer/vagrant/Vagrantfile-boottools-vbox index 83348f02..14306402 100644 --- a/installer/vagrant/Vagrantfile-boottools-vbox +++ b/installer/vagrant/Vagrantfile-boottools-vbox @@ -12,14 +12,14 @@ VMMEM = 1024 SCRIPT = <<EOT # Set language. export LANG="#{LANGUAGE}.UTF-8" -echo "LANG=\"$LANG\"" > /etc/default/locale -echo "LANG=\"$LANG\"" >> /etc/environment +echo "LANG=\\\"$LANG\\\"" > /etc/default/locale +echo "LANG=\\\"$LANG\\\"" >> /etc/environment locale-gen --lang #{LANGUAGE} -sed -i "s/XKBLAYOUT=.*/XKBLAYOUT=\"${LANG%_*}\"/" /etc/default/keyboard +sed -i "s/XKBLAYOUT=.*/XKBLAYOUT=\\\"${LANG%_*}\\\"/" /etc/default/keyboard dpkg-reconfigure -fnoninteractive console-setup # Install dependencies. apt-get update -y -apt-get install -y subversion +apt-get install -y jq subversion syslinux syslinux-efi syslinux-utils # Prepare environment. groupadd opengnsys mkdir -p /opt/opengnsys/client /tmp/opengnsys_installer/opengnsys diff --git a/installer/vagrant/Vagrantfile-browser-vbox b/installer/vagrant/Vagrantfile-browser-vbox index bc8d55d4..60db8297 100644 --- a/installer/vagrant/Vagrantfile-browser-vbox +++ b/installer/vagrant/Vagrantfile-browser-vbox @@ -13,10 +13,10 @@ VMCPUS = 2 SCRIPT = <<EOT # Set language. export LANG="#{LANGUAGE}.UTF-8" -echo "LANG=\"$LANG\"" > /etc/default/locale -echo "LANG=\"$LANG\"" >> /etc/environment +echo "LANG=\\\"$LANG\\\"" > /etc/default/locale +echo "LANG=\\\"$LANG\\\"" >> /etc/environment locale-gen --lang #{LANGUAGE} -sed -i "s/XKBLAYOUT=.*/XKBLAYOUT=\"${LANG%_*}\"/" /etc/default/keyboard +sed -i "s/XKBLAYOUT=.*/XKBLAYOUT=\\\"${LANG%_*}\\\"/" /etc/default/keyboard dpkg-reconfigure -fnoninteractive console-setup # Install main dependencies. apt-get update diff --git a/installer/vagrant/Vagrantfile-devel-vbox b/installer/vagrant/Vagrantfile-devel-vbox index 00d7dab6..7aac2c56 100644 --- a/installer/vagrant/Vagrantfile-devel-vbox +++ b/installer/vagrant/Vagrantfile-devel-vbox @@ -38,7 +38,12 @@ if [ -z "$(blkid /dev/mapper/og-images | grep ext4)" ]; then mount -a fi # Install OpenGnsys and change server address. -curl -s https://raw.githubusercontent.com/opengnsys/OpenGnsys/devel/installer/opengnsys_installer.sh | bash || exit $? +if which curl &>/dev/null; then + DOWNLOAD="curl -s" +elif which wget &>/dev/null; then + DOWNLOAD="wget -q -O -" +fi +$DOWNLOAD -s https://raw.githubusercontent.com/opengnsys/OpenGnsys/devel/installer/opengnsys_installer.sh | bash || exit $? mv /opt/opengnsys/log/bash.log /opt/opengnsys/log/opengnsys_installer.log echo y | /opt/opengnsys/bin/setserveraddr enp0s8 # Insert DHCP data. @@ -48,10 +53,10 @@ done service isc-dhcp-server restart # Set language. export LANG="#{LANGUAGE}.UTF-8" -echo "LANG=\"$LANG\"" > /etc/default/locale -echo "LANG=\"$LANG\"" >> /etc/environment +echo "LANG=\\\"$LANG\\\"" > /etc/default/locale +echo "LANG=\\\"$LANG\\\"" >> /etc/environment locale-gen --lang #{LANGUAGE} -sed -i "s/XKBLAYOUT=.*/XKBLAYOUT=\"${LANG%_*}\"/" /etc/default/keyboard +sed -i "s/XKBLAYOUT=.*/XKBLAYOUT=\\\"${LANG%_*}\\\"/" /etc/default/keyboard dpkg-reconfigure -fnoninteractive console-setup # Comment out next lines for automatic data insertion. #SQL="INSERT INTO aulas (nombreaula, idcentro, urlfoto, grupoid, ubicacion, puestos, modomul, ipmul, pormul, velmul, router, netmask, ntp, dns, proxy, modp2p, timep2p) VALUES ('Aula virtual', 1, 'aula.jpg', 0, 'Despliegue virtual con Vagrant.', 5, 2, '239.194.2.11', 9000, 70, '#{NETPREFIX}.1', '255.255.255.0', '', '', '', 'peer', 30); INSERT INTO ordenadores (nombreordenador, ip, mac, idaula, idrepositorio, idperfilhard, idmenu, idproautoexec, grupoid, router, mascara, arranque, netiface, netdriver, fotoord) VALUES" @@ -94,12 +99,12 @@ OGAGENTPKG = "ogagent_1.1.0_all.deb" MODELSCRIPT = <<EOT # Comment out next lines to install and configure OGAgent for Ubuntu. #apt-get update -y -#curl -ks https://#{SERVERIP}/opengnsys/descargas/#{OGAGENTPKG} -o #{OGAGENTPKG} -#if [ -f #{OGAGENTPKG} ]; then -# dpkg -i #{OGAGENTPKG} -# apt-get install -fy || exit $? +#apt-get install -y curl +#curl -ks https://#{SERVERIP}/opengnsys/descargas/#{OGAGENTPKG} -o /tmp/#{OGAGENTPKG} +#if [ -f /tmp/#{OGAGENTPKG} ]; then +# apt-get install -y /tmp/#{OGAGENTPKG} || exit $? # sed -i "0,/remote=/ s,remote=.*,remote=https://#{SERVERIP}/opengnsys/rest/," /usr/share/OGAgent/cfg/ogagent.cfg -# rm -f #{OGAGENTPKG} +# rm -f /tmp/#{OGAGENTPKG} #else # echo "Warning: cannot install OGAgent package #{OGAGENTPKG}" #fi diff --git a/installer/vagrant/Vagrantfile-prod-vbox b/installer/vagrant/Vagrantfile-prod-vbox index 813ee962..adeccce7 100644 --- a/installer/vagrant/Vagrantfile-prod-vbox +++ b/installer/vagrant/Vagrantfile-prod-vbox @@ -38,7 +38,12 @@ if [ -z "$(blkid /dev/mapper/og-images | grep ext4)" ]; then mount -a fi # Install OpenGnsys and change server address. -curl -s https://raw.githubusercontent.com/opengnsys/OpenGnsys/master/installer/opengnsys_installer.sh | bash || exit $? +if which curl &>/dev/null; then + DOWNLOAD="curl -s" +elif which wget &>/dev/null; then + DOWNLOAD="wget -q -O -" +fi +$DOWNLOAD -s https://raw.githubusercontent.com/opengnsys/OpenGnsys/master/installer/opengnsys_installer.sh | bash || exit $? mv /opt/opengnsys/log/bash.log /opt/opengnsys/log/opengnsys_installer.log echo y | /opt/opengnsys/bin/setserveraddr enp0s8 # Insert DHCP data. @@ -48,10 +53,10 @@ done service isc-dhcp-server restart # Set language. export LANG="#{LANGUAGE}.UTF-8" -echo "LANG=\"$LANG\"" > /etc/default/locale -echo "LANG=\"$LANG\"" >> /etc/environment +echo "LANG=\\\"$LANG\\\"" > /etc/default/locale +echo "LANG=\\\"$LANG\\\"" >> /etc/environment locale-gen --lang #{LANGUAGE} -sed -i "s/XKBLAYOUT=.*/XKBLAYOUT=\"${LANG%_*}\"/" /etc/default/keyboard +sed -i "s/XKBLAYOUT=.*/XKBLAYOUT=\\\"${LANG%_*}\\\"/" /etc/default/keyboard dpkg-reconfigure -fnoninteractive console-setup # Comment out next lines for automatic data insertion. #SQL="INSERT INTO aulas (nombreaula, idcentro, urlfoto, grupoid, ubicacion, puestos, modomul, ipmul, pormul, velmul, router, netmask, ntp, dns, proxy, modp2p, timep2p) VALUES ('Aula virtual', 1, 'aula.jpg', 0, 'Despliegue virtual con Vagrant.', 5, 2, '239.194.2.11', 9000, 70, '#{NETPREFIX}.1', '255.255.255.0', '', '', '', 'peer', 30); INSERT INTO ordenadores (nombreordenador, ip, mac, idaula, idrepositorio, idperfilhard, idmenu, idproautoexec, grupoid, router, mascara, arranque, netiface, netdriver, fotoord) VALUES" @@ -73,12 +78,12 @@ OGAGENTPKG = "ogagent_1.1.0_all.deb" MODELSCRIPT = <<EOT # Comment out next lines to install and configure OGAgent for Ubuntu. #apt-get update -y -#curl -ks https://#{SERVERIP}/opengnsys/descargas/#{OGAGENTPKG} -o #{OGAGENTPKG} -#if [ -f #{OGAGENTPKG} ]; then -# dpkg -i #{OGAGENTPKG} -# apt-get install -fy || exit $? +#apt-get install -y curl +#curl -ks https://#{SERVERIP}/opengnsys/descargas/#{OGAGENTPKG} -o /tmp/#{OGAGENTPKG} +#if [ -f /tmp/#{OGAGENTPKG} ]; then +# apt-get install -y /tmp/#{OGAGENTPKG} || exit $? # sed -i "0,/remote=/ s,remote=.*,remote=https://#{SERVERIP}/opengnsys/rest/," /usr/share/OGAgent/cfg/ogagent.cfg -# rm -f #{OGAGENTPKG} +# rm -f /tmp/#{OGAGENTPKG} #else # echo "Warning: cannot install OGAgent package #{OGAGENTPKG}" #fi diff --git a/repoman/bin/checkrepo b/repoman/bin/checkrepo index b38a689b..5b50dcda 100755 --- a/repoman/bin/checkrepo +++ b/repoman/bin/checkrepo @@ -1,9 +1,9 @@ #!/bin/bash #/** -# checkrepo #@file checkrepo -#@brief Generate repository information in a JSON file. +#@brief Maintain repository information in a JSON file. +#@usage checkrepo #@warning This script uses "jq" command. #@version 1.1.0 - Initial version. #@author Ramón M. Gómez - ETSII Univ. Sevilla @@ -18,15 +18,8 @@ IMAGESDIR=$OPENGNSYS/images INFOFILE=$OPENGNSYS/etc/repoinfo.json -# Auxiliar functions. - -# Metafunction to check if JSON result exists. -function jq() { - local OUTPUT - OUTPUT=$($JQ "$@") || return $? - [[ "$OUTPUT" = "null" ]] && return 1 - echo "$OUTPUT" -} +# Functions. +source $OPENGNSYS/lib/ogfunctions.sh # Create/edit JSON file about installed ogLive clients. function addToJson() { @@ -105,7 +98,7 @@ EOT # Create new JSON file. if [ -z "$OUNAME" ]; then cat << EOT | jq . > $INFOFILE -{"directory":"$IMAGESDIR","images":[$JSON],"ous":[]} +{"directory":"$IMAGESDIR","images":[${IMAGENAME:+$JSON}],"ous":[]} EOT else cat << EOT | jq . > $INFOFILE @@ -115,34 +108,6 @@ EOT fi } -# Show an error message. -function raiseError() { - case "$1" in - usage) - echo "$PROG: Usage error: Type \"$PROG help\"" >&2 - exit 1 ;; - notfound) - echo "$PROG: Resource not found: $2" >&2 - exit 2 ;; - access) - echo "$PROG: Access error: $2" >&2 - exit 3 ;; - *) - echo "$PROG: Unknown error" >&2 - exit 1 ;; - esac -} - -# Command functions. - -# Show help message. -function help() { - cat << EOT -$PROG: maintain the repository information. -Usage: $PROG -EOT -} - # Check for file-based images to update the repository configuration file. function checkfiles() { local IMAGES IMG INFO DATA @@ -220,8 +185,8 @@ function checkremoved() { # Main progrram. # Check dependencies. -[ ! -w "$(dirname "$INFOFILE")" ] && raiseError access "$INFOFILE" -JQ=$(which jq 2>/dev/null) || raiseError notfound "Need to install \"jq\"." +[ -w "$(dirname "$INFOFILE")" ] || raiseError access "$INFOFILE" +[ -e "$INFOFILE" ] || addToJson which sponge &>/dev/null || raiseError notfound "Need to install \"moreutils\"." checkfiles diff --git a/repoman/bin/getRepoIface b/repoman/bin/getRepoIface new file mode 100755 index 00000000..2ce208be --- /dev/null +++ b/repoman/bin/getRepoIface @@ -0,0 +1,9 @@ +#!/bin/bash + +# This script takes the IPlocal variable of the repository +# and returns the system interface +# Alfredo Luque <aluque@soleta.eu> + +source /opt/opengnsys/etc/ogAdmRepo.cfg + +ip addr show | grep $IPlocal | cut -f2 | awk '{ print $NF }' diff --git a/repoman/bin/importimage b/repoman/bin/importimage new file mode 100755 index 00000000..3a5a7bf3 --- /dev/null +++ b/repoman/bin/importimage @@ -0,0 +1,165 @@ +#!/bin/bash +#/** +#@file importimage +#@usage importimage [str_user] str_repo str_imagename +#@brief Imports an image file from other repository +#@param str_user username to access the remote repository (local user, by default) +#@param str_repo repository IP address or hostaname +#@param str_imagename image name to download +#@warning Program will request the repository REST token. +#@version 1.1.1 - Initial version +#@author Ramón M. Gómez, ETSII Universidad de Sevilla +#@date 2017-10-08 +#*/ + + +# Variables. +PROG="$(basename "$0")" +OPENGNSYS="/opt/opengnsys" +REPODIR="$OPENGNSYS/images" +SERVERCONF="$OPENGNSYS/etc/ogAdmServer.cfg" +DEFAULTFILE="/etc/default/opengnsys" +MYCNF=$(mktemp /tmp/.my.cnf.XXXXX) +let BACKUP=0 +source $DEFAULTFILE + +# Functions. +source $OPENGNSYS/lib/ogfunctions.sh + + +# Main program. + +# Error control. +[ "$USER" == "root" ] || raiseError access "Need to be root." +[ "$RUN_OGADMREPO" == "yes" ] || raiseError access "This server is not defined as image repository." +[ -w $REPODIR ] || raiseError access "Cannot write in local repository." +case $# in + 2) USERNAME="$SUDO_USER"; REPO="$1"; IMAGE="$2" ;; + 3) USERNAME="$1"; REPO="$2"; IMAGE="$3" ;; + *) [ "$*" == "help" ] && help || raiseError usage +esac +source $SERVERCONF &>/dev/null +[ "${REPO,,}" == "${HOSTNAME,,}" ] || [ "${REPO,,}" == "localhost" ] || [ "${REPO}" == "127.0.0.1" ] || [ "${REPO,,}" == "${IPlocal,,}}" ] && raiseError access "Cannot import from local repository." + +# Fetching image info from the repository. +read -rp "Enter repository API token: " APITOKEN +IMAGEINFO="$(curl -k -H "Authorization: $APITOKEN" "https://$REPO/opengnsys/rest/repository/image/$IMAGE" 2> /dev/null | jq -r .)" +IMAGENAME="$(jq -r '.name' <<< "$IMAGEINFO" 2>/dev/null)" +case "$IMAGEINFO" in + "") # Connection error. + raiseError access "Cannot connect to $REPO" ;; + "[]") # Image not found. + raiseError notfound "Image $IMAGE in remote repository $REPO" ;; + *) # Checking REST error. + MESSAGE="$(jq -r '.message' <<< "$IMAGEINFO" 2>/dev/null)" + [ -n "$MESSAGE" ] && raiseError access "$MESSAGE" +esac +IMAGETYPE="$(jq -r '.type' <<< "$IMAGEINFO" 2>/dev/null)" +IMAGELOCKED="$(jq -r '.locked' <<< "$IMAGEINFO" 2>/dev/null)" +[ "$IMAGELOCKED" == "true" ] && raiseError access "Image locked by remote repository." +IMAGESIZE="$(jq -r '.size' <<< "$IMAGEINFO" 2>/dev/null)" +[ -z "$IMAGESIZE" ] && raiseError access "Cannot retrieve image size" +# Checking if local image exists. +IMAGEPATH="$REPODIR/$IMAGENAME.$IMAGETYPE" +if [ -e "$IMAGEPATH" ]; then + # Checking if local image is locked. + LOCKFILE="$IMAGEPATH.lock" + [ -f "$LOCKFILE" ] && raiseError access "Local image is locked, cannot write." + # Confirm image download. + read -rp "Image $IMAGENAME exists in the local repository. Do you want to continue? (y/N): " ANSWER + [ "${ANSWER,,}" = "y" ] || exit + BACKUP=1 + REMOTEDATE=$(jq -r '.modified' <<< "$IMAGEINFO" 2>/dev/null) + LOCALDATE=$(stat -c "%y" "$IMAGEPATH" | cut -f1 -d.) + if [[ "$REMOTEDATE" < "$LOCALDATE" ]]; then + read -rp "Remote image seems older than the local one. Do you want to continue? (y/N): " ANSWER + [ "${ANSWER,,}" = "y" ] || exit + fi +fi + +# Trapping signal to unlock image before exit. +trap "rm -f $LOCKFILE $MYCNF" 1 2 3 6 9 15 +# Creating lock file. +touch $LOCKFILE +# Backing up local image. +if [ $BACKUP -eq 1 ]; then + mv -vf "$IMAGEPATH" "$IMAGEPATH.ant" 2>/dev/null + mv -vf "$IMAGEPATH.torrent" "$IMAGEPATH.torrent.ant" 2>/dev/null + mv -vf "$IMAGEPATH.sum" "$IMAGEPATH.sum.ant" 2>/dev/null + mv -vf "$IMAGEPATH.full.sum" "$IMAGEPATH.full.sum.ant" 2>/dev/null +fi +# Downloading image file. +[[ $IMAGEPATH =~ / ]] && mkdir -p "$(dirname "$IMAGEPATH")" +scp "$USERNAME@$REPO:$IMAGEPATH" $REPODIR +ERRCODE=$? +if [ $ERRCODE -eq 0 ]; then + # Storing creation info. + jq -r '.clonator+":"+.compressor+":"+.filesystem+":"+(.datasize|tostring)+":"' <<<"$IMAGEINFO" > "$IMAGEPATH.info" + # Updating the database when the repo is also configured as Administration Server. + if [ "$RUN_OGADMREPO" == "yes" ]; then + # Creating credentials file. + cat << EOT > $MYCNF +[client] +user=$USUARIO +password=$PASSWORD +EOT + if [ $BACKUP -eq 1 ]; then + # If the image exists, increase its revision number. + mysql --defaults-extra-file=$MYCNF -D "$CATALOG" -e \ + "UPDATE imagenes + SET revision = revision + 1 + WHERE nombreca='$IMAGE';" || \ + echo "Warning: database cannot be updated." + else + # Obtaining defined Organizational Units. + while read -re DATA; do + OUS[${#OUS[@]}]="$DATA" + done <<<$(mysql --defaults-extra-file=$MYCNF -D "$CATALOG" -Nse \ + "SELECT idcentro, nombrecentro FROM centros;") + if [ ${#OUS[@]} -eq 1 ]; then + # Only 1 OU is defined. + let OUID="${OUS%% *}" + else + # Choose image OU. + echo "Choose Organization Unit:" + for ((i=0; i<${#OUS[@]}; i++)); do + echo " $i: ${OUS[i]#* }" + done + read -rp "Enter number (0 by default): " ANSWER + let OUID="${OUS[ANSWER]%% *}" 2>/dev/null || let OUID="${OUS[0]%% *}" + fi + # Creating a new image associated with an empty software profile. + mysql --defaults-extra-file=$MYCNF -D "$CATALOG" -e \ + "SET @repoid = (SELECT idrepositorio FROM repositorios + WHERE ip='$IPlocal' LIMIT 1), + @profname = '$IMAGE imported from $REPO'; + INSERT INTO perfilessoft (descripcion, idcentro, grupoid) + SELECT @profname, '$OUID', 0 FROM DUAL + WHERE NOT EXISTS + (SELECT descripcion FROM perfilessoft + WHERE descripcion=@profname AND idcentro='$OUID') + LIMIT 1; + SET @profid = LAST_INSERT_ID(); + INSERT INTO imagenes + (nombreca, revision, idperfilsoft, idcentro, comentarios, grupoid, idrepositorio, fechacreacion) + VALUES ('$IMAGE', 1, @profid, '$OUID', 'Image imported from repo $REPO', 0, @repoid, NOW());" || \ + echo "Warning: database cannot be updated." + fi + fi + # Cheking image size. + DOWNLOADSIZE=$(stat -c "%s" "$IMAGEPATH") + [ $IMAGESIZE -ne $DOWNLOADSIZE ] && echo "Warning: image sizes differ: source=$IMAGESIZE, target=$DOWNLOADSIZE." +else + # On download error, trying to recover backup. + raiseError download "$USERNAME@$REPO:$IMAGEPATH" + if [ $BACKUP -eq 1 ]; then + mv -vf "$IMAGEPATH.ant" "$IMAGEPATH" 2>/dev/null + mv -vf "$IMAGEPATH.torrent.ant" "$IMAGEPATH.torrent" 2>/dev/null + mv -vf "$IMAGEPATH.sum.ant" "$IMAGEPATH.sum" 2>/dev/null + mv -vf "$IMAGEPATH.full.sum.ant" "$IMAGEPATH.full.sum" 2>/dev/null + fi +fi + +# Unlocking image and removing temporary file. +rm -f $LOCKFILE $MYCNF + diff --git a/repoman/bin/opengnsys.cron b/repoman/bin/opengnsys.cron index 78f01db5..32c6f493 100755 --- a/repoman/bin/opengnsys.cron +++ b/repoman/bin/opengnsys.cron @@ -31,9 +31,4 @@ if [ "$RUN_OGADMSERVER" == "yes" ]; then /etc/init.d/opengnsys restart fi fi -# Reiniciar servicios si es repositorio y proceso ogAdmRepo está caído. -if [ "$RUN_OGADMREPO" == "yes" -a $(pgrep ogAdmRepo | wc -w) == 0 ]; then - date +"%d/%m/%Y %H:%M ERROR: El servicio ogAdmRepo estaba caido, se reinicia" >> $LOGDIR/ogAdmRepo.log - /etc/init.d/opengnsys restart -fi diff --git a/repoman/bin/sendFileMcast b/repoman/bin/sendFileMcast index ac6446d8..222a6d40 100755 --- a/repoman/bin/sendFileMcast +++ b/repoman/bin/sendFileMcast @@ -9,7 +9,8 @@ OPENGNSYS=${OPENGNSYS:-"/opt/opengnsys"} OGIMG=$OPENGNSYS/images OGBIN=$OPENGNSYS/bin PATH=$PATH:$OGBIN - +REPO_IFACE="$(/opt/opengnsys/bin/getRepoIface)" + # Si se solicita, mostrar ayuda. if [ "$*" == "help" ]; then echo "Formato: $PROG fichero|nombreImagen datosMulticast" @@ -57,5 +58,5 @@ CERROR="8x8/128" # Envío de fichero por Multicast. # Se desabilita el uso de mbuffer: eesta versión del upd-sender no la admite. #which mbuffer &> /dev/null && MBUFFER="--pipe 'mbuffer -m 20M'" -$OGBIN/udp-sender $MBUFFER --nokbd --retries-until-drop 65 --portbase $PORTBASE --$METHOD --mcast-data-address $ADDRESS --fec $CERROR --max-bitrate $BITRATE --ttl 16 --min-clients $NCLIENTS --max-wait $MAXTIME --file "$FICHIMG" +$OGBIN/udp-sender $MBUFFER --nokbd --retries-until-drop 65 --portbase $PORTBASE --$METHOD --interface $REPO_IFACE --mcast-data-address $ADDRESS --fec $CERROR --max-bitrate $BITRATE --ttl 16 --min-clients $NCLIENTS --max-wait $MAXTIME --file "$FICHIMG" diff --git a/repoman/etc/logrotate.tmpl b/repoman/etc/logrotate.tmpl new file mode 100644 index 00000000..62cdbaf0 --- /dev/null +++ b/repoman/etc/logrotate.tmpl @@ -0,0 +1,22 @@ +# Configuración de logrotate para el servidor de repositorio de OpenGnsys +# Los archivos se copian y luego se corta el original, para que los equipos puedan seguir escribiendo sobre ellos +# Las copias se comprimen +# Los registros de las transferencias multicast se guardan una semana (repo). +# El resto de los registros se comprueban diariamente que no excedan 100k. Se mantienen los últimos 5. +# Con esta condición los servicios de OpenGnsys Repository conservan datos de más de un mes. + +copytruncate +compress + +prerotate + find /opt/opengnsys/log/mcastlog -type f -mtime +7 -exec rm -f {} \; +endscript + +/opt/opengnsys/log/bttrack.log +/opt/opengnsys/log/torrent-creator.log +/opt/opengnsys/log/ogAdmRepo.log +/opt/opengnsys/log/opengnsys.log +{ + rotate 5 + size 100k +} diff --git a/admin/Sources/Services/ogAdmRepo/ogAdmRepo.cfg b/repoman/etc/ogAdmRepo.cfg.tmpl index 1a8f289d..ed68ea60 100644 --- a/admin/Sources/Services/ogAdmRepo/ogAdmRepo.cfg +++ b/repoman/etc/ogAdmRepo.cfg.tmpl @@ -1,3 +1,2 @@ IPlocal=SERVERIP -Puerto=2002 ApiToken=REPOKEY diff --git a/server/bin/checkperms b/server/bin/checkperms index fbe3be0f..5c558c45 100755 --- a/server/bin/checkperms +++ b/server/bin/checkperms @@ -57,5 +57,5 @@ chown -R $APACHE_USER:$APACHE_GROUP $OPENGNSYS_DIR/tftpboot/menu.lst chown -R :$OPENGNSYS_USER $OPENGNSYS_DIR/tftpboot/ogLive* find -L $OPENGNSYS_DIR/tftpboot -type d -exec chmod 755 {} \; find -L $OPENGNSYS_DIR/tftpboot -type f -exec chmod 644 {} \; -chown $APACHE_USER:$APACHE_GROUP $OPENGNSYS_DIR/log/ogagent.log +chown $APACHE_USER:$APACHE_GROUP $OPENGNSYS_DIR/log/{ogagent,remotepc,rest}.log diff --git a/server/bin/ogagentqueue.cron b/server/bin/ogagentqueue.cron index 0cf0dd5d..d44efdff 100755 --- a/server/bin/ogagentqueue.cron +++ b/server/bin/ogagentqueue.cron @@ -77,10 +77,10 @@ SELECT ogagent_queue.id, ogagent_queue.exectime, ogagent_queue.operation, if [ -n "$AGNTURL" ]; then CODE=$(curl -ksm 1 -w "%{http_code}" -o /dev/null -H "Authorization: $AGNTKEY" ${DATA:+"-d $DATA"} "$AGNTURL") case "$CODE" in - 000) # Client does not respond may be halted). + 000) # Client does not respond (may be halted). ;; - 200) # Operation sended. - echo "$(date +"%FT%T%z"): $PROG: Operation sended to OGAgent: client=$AGNTIP, oper=$OPER, exectime=\"$DATE $TIME\"" >> $LOGFILE ;; + 200) # Operation sent. + echo "$(date +"%FT%T%z"): $PROG: Operation sent to OGAgent: client=$AGNTIP, oper=$OPER, exectime=\"$DATE $TIME\"" >> $LOGFILE ;; *) # Operation error. echo "$(date +"%FT%T%z"): $PROG: Operation error: client=$AGNTIP, oper=$OPER, code=$CODE" >> $LOGFILE ;; esac diff --git a/server/bin/setclientmode b/server/bin/setclientmode index 53ccf26e..855ae4a6 100755 --- a/server/bin/setclientmode +++ b/server/bin/setclientmode @@ -19,6 +19,9 @@ #@version 1.1.0 - Se incluye la unidad organizativa como parametro del kernel: ogunit=directorio_unidad (ticket #678). #@author Irina Gomez, ETSII Universidad de Sevilla #@date 2015-12-16 +#@version 1.1.0a - El server siempre es el servidor PXE. El segundo parámetro de la IP es el SERVER. La asignación del ogLive siempre es el server. (ticket #859). +#@author Antonio J. Doblas Viso, Universidad de Malaga +#@date 2018-07-11 #*/ ## @@ -94,12 +97,13 @@ for MAC in $ETHERNET; do DATOS=$(mysql --defaults-extra-file=$MYCNF -D "$CATALOG" -s -N -e \ "SELECT ' LANG=$LANG', ' ip=', CONCAT_WS(':', ordenadores.ip, - (@repoip:=repositorios.ip), aulas.router, aulas.netmask, + (SELECT (@serverip:=ipserveradm) FROM entornos LIMIT 1), + aulas.router, aulas.netmask, ordenadores.nombreordenador, ordenadores.netiface, 'none'), ' group=', REPLACE(TRIM(aulas.nombreaula), ' ', '_'), - ' ogrepo=', @repoip, - ' oglive=', @repoip, - ' oglog=', (SELECT (@serverip:=ipserveradm) FROM entornos LIMIT 1), + ' ogrepo=', (@repoip:=IFNULL(repositorios.ip, '')), + ' oglive=', @serverip, + ' oglog=', @serverip, ' ogshare=', @serverip, ' oglivedir=', ordenadores.oglivedir, IF(perfileshard.descripcion<>'', CONCAT(' hardprofile=', REPLACE(TRIM(perfileshard.descripcion), ' ', '_')), ''), @@ -117,7 +121,7 @@ for MAC in $ETHERNET; do JOIN aulas USING(idaula) JOIN centros USING(idcentro) JOIN entidades USING(identidad) - JOIN repositorios USING(idrepositorio) + LEFT JOIN repositorios USING(idrepositorio) LEFT JOIN perfileshard USING(idperfilhard) LEFT JOIN menus USING(idmenu) WHERE ordenadores.mac='$MAC';") diff --git a/server/bin/setserveraddr b/server/bin/setserveraddr index bdcfb796..eb52d64d 100755 --- a/server/bin/setserveraddr +++ b/server/bin/setserveraddr @@ -1,21 +1,32 @@ #!/bin/bash -# setserveraddr: modifica los ficheros de configuración para asignar los valores -# de la interfaz de red solicitada. -# Nota: se enlazan los ficheros a los predefinidos detectados para la interfaz. -# Uso: setserveraddr iface -# Autor: Ramon Gomez - Univ. Sevilla -# Fecha: 2011-01-25 -# Versión: 1.0.5 - Regenerar ficheros de configuración. -# Autor: Ramon Gomez - Univ. Sevilla -# Fecha: 2014-06-06 - -# Variables globales. -PROG="$(basename $0)" - -# Comprobar parámetros. +#/** +# setserveraddr {str_ipaddress | str_netiface} +#@file setserveraddr +#@brief Command the modifies configuration files to assign the default network interface. +#@param str_ipaddress IP address assigned to a network interface +#@param str_netiface network interface name defined by the operating system. +#@version Initial version. +#@author Ramón M. Gómez - ETSII Univ. Sevilla +#@date 2011-01-25 +#@version 1.0.5 - Regenerate configuration files. +#@author Ramón M. Gómez - ETSII Univ. Sevilla +#@date 2014-06-06 +#@version 1.1.1 - Updating menu URLs, PXE files, and repository API key. +#@author Ramón M. Gómez - ETSII Univ. Sevilla +#@date 2018-11-15 +#*/ ## + + +# Variables. +PROG="$(basename "$0")" +OPENGNSYS=/opt/opengnsys +PXEDIR=$OPENGNSYS/tftpboot/menu.lst +DEFAULTFILE=/etc/default/opengnsys + +# Checking parameters. if [ $# -ne 1 ]; then - echo "$PROG: Incorrect operand. Format: $PROG interface" >&2 + echo "$PROG: Incorrect operand. Format: $PROG ipaddress|netiface" >&2 exit 1 fi if [ "$USER" != "root" ]; then @@ -23,36 +34,40 @@ if [ "$USER" != "root" ]; then exit 1 fi -# Aviso informando de que los clientes iniciados pueden quedarse colgados. -read -p "WARNING: initiated clients can hang. Continue? (y/n): " ANSWER -if [ "${ANSWER^^}" != "Y" ]; then +# Showing warning to inform that initiated clients may hang. +read -rp "WARNING: initiated clients can hang. Continue? (y/n): " ANSWER +if [ "${ANSWER,,}" != "y" ]; then echo "Operation canceled." exit 0 fi -# Detectar la interfaz de red. -DEVICES=$(ip -o link show up|awk -F: '$2!~/lo/ {print $2}') +# Detecting network interfaces. +DEVICES=$(ip -o link show up | awk -F: '$2!~/lo/ {print $2}') for DEV in $DEVICES; do - # Si se encuentra la interfaz de red, obtener su dirección IP. - [ "$DEV" == "$1" ] && SERVERIP=$(ip -o addr show dev $DEV | awk '$3~/inet$/ {sub (/\/.*/, ""); print ($4)}') + # If the network interface is found, get its IP address. + IP=$(ip -o addr show dev "$DEV" | awk '$3~/inet$/ {sub (/\/.*/, ""); print ($4)}') + if [ "$DEV" == "$1" ] || [ "$IP" == "$1" ]; then + SERVERIP="$IP" + SERVERDEV="$DEV" + fi done -# Comprobar si se ha detectado dirección IP. +# Checking if IP address has been detected. if [ -n "$SERVERIP" ]; then - # Ficheros temporales. + # Temporary files. tmpfile=$(mktemp /tmp/og.XXXXX) MYCNF=$(mktemp /tmp/.my.cnf.XXXXX) trap "rm -f $tmpfile $MYCNF" 1 2 3 6 9 15 - # Comprobar si hay que modificar la configuración de DHCP. + # Checking whether the DHCP settings need to be changed. CHANGE=0 for f in /etc/{dhcp,hcp3}/dhcpd.conf; do if [ -f $f ]; then - # Cambiar el parámetro "next-server" de DHCP. - file="${f/./-$1.}" + # Changing DHCP "next-server" parameter. + file="${f/./-$SERVERDEV.}" sed -e "s/next-server.*/next-server $SERVERIP;/" \ -e "s/option routers ;/option routers ${SERVERIP%.*}.1;/" $file >$tmpfile - # Copiar el fichero y enlazarlo si hay cambios. + # Copying and linking file if there are changes. if [ ! $f -ef $file ] || ! diff -q $tmpfile $file &>/dev/null; then mv $tmpfile $file chmod 644 $file @@ -61,7 +76,7 @@ if [ -n "$SERVERIP" ]; then fi fi done - # Si ha cambiado la configuración, reiniciar DHCP. + # Restarting DHCP service if its configuration has changed. if [ $CHANGE == 1 ]; then for f in /etc/init.d/{isc-dhcp-server,dhcp3-server,dhcpd}; do [ -x $f ] && $f restart @@ -70,80 +85,94 @@ if [ -n "$SERVERIP" ]; then echo "DHCP configuration has not changed." fi - # Guardar la IP anterior del repositorio. - OPENGNSYS=/opt/opengnsys + # Saving old IP address. source $OPENGNSYS/etc/ogAdmRepo.cfg OLDSERVERIP=$IPlocal - # Comprobar si hay que modificar la configuración de OpenGnsys. + # Checking if configuration files need to be modified. CHANGE=0 - # Procesar los ficheros de configuración de OpenGnsys. for f in $OPENGNSYS/{etc/{ogAdmServer,ogAdmRepo,ogAdmAgent}.cfg,www/controlacceso.php,client/etc/ogAdmClient.cfg}; do - # Error si no existe algún fichero de configuración. + # Error if configuration file cannot be found. if [ ! -f $f ]; then echo "$PROG: File $file does not exist." >&2 exit 2 fi - # Cambiar la IP del servidor: - # - variables ServidorAdm e IPlocal, - # - servidor o IP en URLs excepto si contienen "localhost". + # Updating configuration variables (if URLs does not contain "localhost"). sed -e "s,ServidorAdm=.*,ServidorAdm=$SERVERIP," \ -e "s,IPlocal=.*,IPlocal=$SERVERIP," \ -e "s,UrlMenu=https?://\([^/]*\)/\(.*\),UrlMenu=https://$SERVERIP/\2," \ -e '/localhost/!s,https\?://[^/]*/\(.*\),https://'$SERVERIP'/\1,' $f >$tmpfile - file="${f/./-$1.}" - # Si se usa otro interfaz o cambian los datos de red; ... + file="${f/./-$SERVERDEV.}" + # Copying updated file, if needed. if [ ! $f -ef $file ] || ! diff -q $tmpfile $file &>/dev/null; then - # Copiar el fichero y enlazarlo. cp $tmpfile $file ln -f $file $f CHANGE=1 fi done - # Si ha cambiado la configuración, reiniciar OpenGnsys y actualizar la BD. + # Processing when something has changed. if [ $CHANGE == 1 ]; then + # Restart OpenGnsys services. /etc/init.d/opengnsys restart - source $OPENGNSYS/etc/ogAdmServer.cfg - # Componer fichero con credenciales de conexión. - cat << EOT > $MYCNF + # If Repository is active, generating a new API token. + source $DEFAULTFILE + if [ "$RUN_OGADMREPO" == "yes" ]; then + REPOKEY=$(php -r 'echo md5(uniqid(rand(), true));') + sed -i -e "s/ApiToken=.*/ApiToken=$REPOKEY/" $OPENGNSYS/etc/ogAdmRepo.cfg + fi + # If OpenGnsys Server is active, updating the database. + if [ "$RUN_OGADMSERVER" == "yes" ]; then + source $OPENGNSYS/etc/ogAdmServer.cfg + # Creating credentials file. + cat << EOT > $MYCNF [client] user=$USUARIO password=$PASSWORD EOT - # Actualizar IP del servidor en la BD. - mysql --defaults-extra-file=$MYCNF -D "$CATALOG" -e \ - "UPDATE entornos - SET ipserveradm='$SERVERIP' - WHERE identorno=1" - - # Actualizar IP del repositorio en la BD. - mysql --defaults-extra-file=$MYCNF -D "$CATALOG" -e \ - "UPDATE repositorios - SET ip='$SERVERIP' - WHERE ip='$OLDSERVERIP'" + # Updating OpenGnsys Server IP address. + mysql --defaults-extra-file=$MYCNF -D "$CATALOG" -e \ + "UPDATE entornos + SET ipserveradm='$SERVERIP' + WHERE identorno=1" + # If OpenGnsys Repository is active, updating IP address and API token. + if [ "$RUN_OGADMREPO" == "yes" ]; then + mysql --defaults-extra-file=$MYCNF -D "$CATALOG" -e \ + "UPDATE repositorios + SET ip='$SERVERIP', apikey='$REPOKEY' + WHERE ip='$OLDSERVERIP'" + unset REPOKEY + fi + # Updating all menu URLs. + mysql --defaults-extra-file=$MYCNF -D "$CATALOG" -e \ + "UPDATE menus + SET htmlmenupub = REPLACE(htmlmenupub, '$OLDSERVERIP', '$SERVERIP'), + htmlmenupri = REPLACE(htmlmenupri, '$OLDSERVERIP', '$SERVERIP');" + # Updating all PXE files. + find $PXEDIR -name "01-*" -exec sed -i -e "s/$OLDSERVERIP/$SERVERIP/g" {} \; + fi - # Mostrar instrucciones a realizar tras la ejecución. + # Showing manual task to do after execution. cat << EOT -Default server interface set to: $1 ($SERVERIP) +Default server interface set to: $SERVERDEV ($SERVERIP) Manual tasks: -Check DHCP configuration file and restart service, if needed. -Log-in as Web Console organization user. - - Check URLs in all menus. - - Run Advanced Netboot in all rooms. - +- Check DHCP configuration file and restart service, if needed. +- Check PXE files. +- Log-in as Web Console user: + - Check menu URLs. +${REPOKEY:+" - Update repository API token"} EOT else - # Mensaje indicando que no se han cambiado datos. + # Showing message if nothing changes. echo "Default interface has not changed: $1" fi else - # Error: interfaz de red no encontrado. - echo "$PROG: Network device not found. Format: $PROG interface" >&2 + # Error if network interface is not found. + echo "$PROG: Network device not found. Format: $PROG ipaddress|netiface" >&2 exit 1 fi -# Eliminar ficheros temporales. +# Removing temporary files. rm -f $tmpfile $MYCNF diff --git a/server/etc/apache.conf.tmpl b/server/etc/apache.conf.tmpl index ab49503d..edb3fda8 100644 --- a/server/etc/apache.conf.tmpl +++ b/server/etc/apache.conf.tmpl @@ -2,6 +2,13 @@ Alias /opengnsys CONSOLEDIR +# PHP-FPM configuration +<IfModule proxy_fcgi_module> + <FilesMatch ".+\.ph(p[3457]?|t|tml)$"> + SetHandler "proxy:fcgi://127.0.0.1:9000" + </FilesMatch> +</IfModule> + RewriteEngine On # Redirect HTTP to HTTPS and default configuration. diff --git a/server/etc/logrotate.tmpl b/server/etc/logrotate.tmpl index abe436d1..233efc57 100644 --- a/server/etc/logrotate.tmpl +++ b/server/etc/logrotate.tmpl @@ -1,24 +1,20 @@ +# Configuración de logrotate para el servidor de administración de OpenGnsys # Los archivos se copian y luego se corta el original, para que los equipos puedan seguir escribiendo sobre ellos # Las copias se comprimen -# Clientes: se guardan 500K de cada cliente: se rotan cuando llegan a 100K y se guardan 5 -# Mcastlog: se guardan dos semanas. -# servicios opengnsys y tracker: se guardan 4 semanas - +# Los registros de las transferencias multicast se guardan una semana (repo). +# El resto de los registros se comprueban diariamente que no excedan 100k. Se mantienen los últimos 5. +# Con esta condición los servicios de OpenGnsys Server conservan datos de más de un mes. copytruncate compress -OPENGNSYSDIR/log/clients/*.log { - rotate 5 - size 100k -} -OPENGNSYSDIR/log/mcastlog/ogAdmRepoMcast.*([-0-9]) { - rotate 2 - weekly +/opt/opengnsys/log/clients/*.log +/opt/opengnsys/log/ogAdmServer.log +/opt/opengnsys/log/ogagent.log +/opt/opengnsys/log/opengnsys.log +/opt/opengnsys/log/remotepc.log +/opt/opengnsys/log/rest.log +{ + rotate 5 + size 100k } - -OPENGNSYSDIR/log/bttrack.log OPENGNSYSDIR/log/ogAdmRepo.log OPENGNSYSDIR/log/ogAdmServer.log { - rotate 4 - weekly -} - diff --git a/server/lib/ogfunctions.sh b/server/lib/ogfunctions.sh new file mode 100755 index 00000000..51de6b77 --- /dev/null +++ b/server/lib/ogfunctions.sh @@ -0,0 +1,65 @@ +#!/bin/bash +#/** +#@file ogfunctions.sh +#@brief Generic functions for OpenGnsys Server and OpenGnsys Repository. +#@version 1.1.1 - Initial version +#@author Ramón M. Gómez, ETSII Universidad de Sevilla +#@date 2017-10-08 +#*/ + + +# Showing an error message. +function raiseError() { + case "$1" in + usage) + echo "$PROG: Usage error: Type \"$PROG help\"" >&2 + exit 1 ;; + notfound) + echo "$PROG: Resource not found: $2" >&2 + exit 2 ;; + access) + echo "$PROG: Access error: $2" >&2 + exit 3 ;; + download) + echo "$PROG: Download error: $2" >&2 + exit 4 ;; + *) + echo "$PROG: Unknown error" >&2 + exit 1 ;; + esac +} + +# Showing help message. +function help() { + [ -n "$1" ] && DESCRIPTION="$1" || DESCRIPTION=$(grep "^#@brief" "$0" | cut -f2- -d" ") + shift + if [ -n "$1" ]; then + USAGE="$1" + shift + else + USAGE=$(grep "^#@usage" "$0" | cut -f2- -d" ") + [ -n "$USAGE" ] && PARAMS=$(awk '$1=="#@param" {sub($1,""); print "\t",$0}' "$0") + fi + # Showing help. + echo "$PROG: ${DESCRIPTION:-"no description"}" + echo "Usage: ${USAGE:-"no usage info"}" + [ -n "$PARAMS" ] && echo -e "$PARAMS" + if [ -n "$*" ]; then + echo "Examples:" + while (( "$#" )); do + echo -e "\t$1" + shift + done + fi + exit 0 +} + +# Metafunction to check if JSON result exists. +JQ=$(which jq 2>/dev/null) || raiseError notfound "Need to install \"jq\"." +function jq() { + local OUTPUT + OUTPUT=$($JQ "$@") || return $? + [[ "$OUTPUT" = "null" ]] && return 1 + echo "$OUTPUT" +} + diff --git a/server/lib/security-config b/server/lib/security-config index eb8bf5cf..11961758 100755 --- a/server/lib/security-config +++ b/server/lib/security-config @@ -19,7 +19,8 @@ if [ "$USER" != "root" ]; then fi # UFW configuration. -if which ufw 2>/dev/null; then +if which ufw &>/dev/null; then + echo "Configuring UFW." # Adding active services. ufw allow "Apache Secure" ufw allow OpenSSH @@ -28,14 +29,16 @@ if which ufw 2>/dev/null; then ufw allow rsync ufw allow tftp ufw allow 67,68/udp # DHCP - ufw allow 2002,2008/tcp # OpenGnsys services - ufw allow 9000:9051/udp # Multicast + ufw allow 2008/tcp # OpenGnsys service ufw allow 6881:6999/udp # BitTorrent + ufw allow 9000/tcp # PHP-FPM + ufw allow 9000:9051/udp # Multicast # Applying configuration. ufw enable # FirewallD configuration. -elif which firewall-cmd 2>/dev/null; then - # Defining OpenGnsys services. +elif which firewall-cmd &>/dev/null; then + echo "Configuring FirewallD." + # Defining services. python -c " import firewall.core.io.service as ios s=ios.Service() @@ -43,15 +46,14 @@ s.short = 'OpenGnsys Server' s.name = 'ogAdmServer' s.ports = [('2008', 'tcp')] ios.service_writer(s, '/etc/firewalld/services') -s.short = 'OpenGnsys Repository' -s.name = 'ogAdmRepo' -s.ports = [('2002', 'tcp')] +s.name = 'php-fpm' +s.ports = [('9000', 'tcp')] ios.service_writer(s, '/etc/firewalld/services')" # Adding active services. firewall-cmd --permanent --add-service=dhcp firewall-cmd --permanent --add-service=https + firewall-cmd --permanent --add-service=php-fpm firewall-cmd --permanent --add-service=mysql --zone internal - firewall-cmd --permanent --add-service=ogAdmRepo firewall-cmd --permanent --add-service=ogAdmServer # Ubuntu 14.04 does not define "rsyncd" service. firewall-cmd --permanent --add-service=rsyncd || \ @@ -70,7 +72,8 @@ else fi # SELinux configuration. -if which setsebool 2>/dev/null; then +if which setsebool &>/dev/null; then + echo "Configuring SELinux." # Configuring Apache. setsebool -P httpd_can_connect_ldap on semanage fcontext -at httpd_sys_content_t "$OPENGNSYS/www(/.*)?" |