From d42d7c7855919623e4498016d047af6aff30e19c Mon Sep 17 00:00:00 2001 From: "Ramón M. Gómez" Date: Tue, 9 Jun 2020 10:25:06 +0200 Subject: #943: Fix a bug in getting Git tag data before updating. --- installer/opengnsys_update.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/installer/opengnsys_update.sh b/installer/opengnsys_update.sh index 38f8069c..f0a6f32f 100755 --- a/installer/opengnsys_update.sh +++ b/installer/opengnsys_update.sh @@ -184,7 +184,7 @@ function autoConfigure() # Choose an available version to update. function chooseVersion() { - local RELEASES DOWNLOADS INSTVERSION INSTRELEASE + local RELEASES DOWNLOADS INSTVERSION INSTRELEASE RELDATE # Development branch. BRANCH="master" @@ -199,10 +199,10 @@ function chooseVersion() # Fetch tags (releases) data from GitHub. while read -pe TAG URL; do if [[ $TAG =~ ^opengnsys- ]]; then - [ "${TAG#opengnsys-}" \< "${INSTVERSION%pre}" ] && break - RELEASES+=( "${TAG}" ) - DOWNLOADS+=( "$URL" ) - #RELDATE=$(curl -s "$URL" | jq -r '.commit.committer.date | split("-") | join("")[:8]') + [ "${TAG#opengnsys-}" \< "${INSTVERSION%pre}" ] && continue + RELDATE=$(curl -s "$URL" | jq -r '.commit.committer.date | split("-") | join("")[:8]') + RELEASES+=( "${TAG} ($RELDATE)" ) + DOWNLOADS+=( "$URL" ) fi done <<< $(curl -s "$API_URL/../../tags" | jq -r '.[] | .name+" "+.commit.url') # Add development (master) branch. @@ -212,10 +212,10 @@ function chooseVersion() if [ ${#RELEASES[@]} -gt 1 ]; then echo "Installed version: $INSTVERSION $INSTRELEASE" echo "Versions available for update (\"$BRANCH\" is the latest development branch):" - PS3="Enter a number: " + PS3="Enter a number (CTRL-C to exit): " select opt in "${RELEASES[@]}"; do if [ -n "$opt" ]; then - BRANCH="$opt" + BRANCH="${opt%% *}" API_URL="${DOWNLOADS[REPLY-1]}" break fi -- cgit v1.2.3-18-g5258 From e03141b974f84dea800317b1038bf4694368c5e5 Mon Sep 17 00:00:00 2001 From: "Ramón M. Gómez" Date: Tue, 9 Jun 2020 11:05:07 +0200 Subject: #983: Releasing OpenGnsys 1.1.1c --- client/engine/UEFI.lib | 0 doc/CHANGELOG.es.txt | 12 +++++++++++- doc/VERSION.json | 2 +- installer/opengnsys_installer.sh | 2 +- installer/vagrant/Vagrantfile-1.1.1b-vbox | 2 +- 5 files changed, 14 insertions(+), 4 deletions(-) mode change 100644 => 100755 client/engine/UEFI.lib diff --git a/client/engine/UEFI.lib b/client/engine/UEFI.lib old mode 100644 new mode 100755 diff --git a/doc/CHANGELOG.es.txt b/doc/CHANGELOG.es.txt index 5a716e47..5fd812c8 100644 --- a/doc/CHANGELOG.es.txt +++ b/doc/CHANGELOG.es.txt @@ -3,6 +3,16 @@ LISTA DE CAMBIOS CHANGELOG.es.txt ======================================== +Lista de cambios incluidos en OpenGnsys 1.1.1c (versión de mantenimiento) +---------------------------------------------- + +Tickets resueltos en módulo OpenGnsys Installer: +#943 Elegir versión a la que se quiere actualizar + +Tickets genéricos resueltos: +#983 Liberar versión de mantenimiento OpenGnsys 1.1.1c + + Lista de cambios incluidos en OpenGnsys 1.1.1b (versión de mantenimiento) ---------------------------------------------- @@ -41,6 +51,7 @@ Tickets resueltos en módulo OpenGnsys Installer: Tickets genéricos resueltos: #959 Liberar versión de mantenimiento OpenGnsys 1.1.1b + Lista de cambios incluidos en OpenGnsys 1.1.1a (versión de mantenimiento) ---------------------------------------------- @@ -58,7 +69,6 @@ Tickets resueltos en módulo OpenGnsys Web Admin Console: #949 Mostrar datos de sesiones de sistemas operativos en propiedades de ordenador Tickets resueltos en módulo OpenGnsys Installer: -#943 Elegir versión a la que se quiere actualizar #945 Script de importación no guarda los triggers de la base de datos (corrección) #950 GitHub ya no permite obtener la copia de trabajo con Subversion (corrección) #951 Posible problema al actualizar la base de datos con MySQL en modo estricto (corrección) diff --git a/doc/VERSION.json b/doc/VERSION.json index 8f4d48ec..13d23c33 100644 --- a/doc/VERSION.json +++ b/doc/VERSION.json @@ -1,6 +1,6 @@ { "project": "OpenGnsys", - "version": "1.1.1b", + "version": "1.1.1c", "codename": "Espeto", "definition": "http://www.andalucia.com/gastronomy/espeto.htm", "release": "" diff --git a/installer/opengnsys_installer.sh b/installer/opengnsys_installer.sh index 87acf220..02ec3cad 100755 --- a/installer/opengnsys_installer.sh +++ b/installer/opengnsys_installer.sh @@ -132,7 +132,7 @@ function globalSetup () else REMOTE=1 fi - BRANCH="opengnsys-1.1.1b" + BRANCH="opengnsys-1.1.1c" CODE_URL="https://codeload.github.com/opengnsys/OpenGnsys/zip/$BRANCH" API_URL="https://api.github.com/repos/opengnsys/OpenGnsys" diff --git a/installer/vagrant/Vagrantfile-1.1.1b-vbox b/installer/vagrant/Vagrantfile-1.1.1b-vbox index cfcb7da6..7db7b8f5 100644 --- a/installer/vagrant/Vagrantfile-1.1.1b-vbox +++ b/installer/vagrant/Vagrantfile-1.1.1b-vbox @@ -4,7 +4,7 @@ VAGRANTFILE_API_VERSION = "2" # VM provider: Oracle VM VirtualBox. ENV['VAGRANT_DEFAULT_PROVIDER'] = "virtualbox" # OpenGnsys version and OGAgent version. -OGVERSION="1.1.1b" +OGVERSION="1.1.1c" # Language (accepted values: es_ES, ca_ES, en_GB). LANGUAGE = "es_ES" ENV['LC_ALL'] = LANGUAGE + ".UTF-8" -- cgit v1.2.3-18-g5258 From 23e53a5f4c886b673d9795734c56a92099715f02 Mon Sep 17 00:00:00 2001 From: "Ramón M. Gómez" Date: Tue, 9 Jun 2020 11:33:55 +0200 Subject: #983: Updating release Vagrantfile. --- installer/vagrant/Vagrantfile-1.1.1b-vbox | 172 ------------------------------ installer/vagrant/Vagrantfile-1.1.1c-vbox | 172 ++++++++++++++++++++++++++++++ installer/vagrant/Vagrantfile-prod-vbox | 2 +- 3 files changed, 173 insertions(+), 173 deletions(-) delete mode 100644 installer/vagrant/Vagrantfile-1.1.1b-vbox create mode 100644 installer/vagrant/Vagrantfile-1.1.1c-vbox diff --git a/installer/vagrant/Vagrantfile-1.1.1b-vbox b/installer/vagrant/Vagrantfile-1.1.1b-vbox deleted file mode 100644 index 7db7b8f5..00000000 --- a/installer/vagrant/Vagrantfile-1.1.1b-vbox +++ /dev/null @@ -1,172 +0,0 @@ -# Vagrantfile to install OpenGnsys virtual environment (production version) using VirtualBox provider. - -VAGRANTFILE_API_VERSION = "2" -# VM provider: Oracle VM VirtualBox. -ENV['VAGRANT_DEFAULT_PROVIDER'] = "virtualbox" -# OpenGnsys version and OGAgent version. -OGVERSION="1.1.1c" -# Language (accepted values: es_ES, ca_ES, en_GB). -LANGUAGE = "es_ES" -ENV['LC_ALL'] = LANGUAGE + ".UTF-8" -# Number of OpenGnsys clients (accepted values: from 2 to 9). -NCLIENTS = 4 -# Repository virtual disk: file and size (GB). -REPODISK = "ogRepo.vdi" -REPOSIZE = 50 -# Amount of memory for server and clients (MB) -SERVERMEM = 1024 # Minimum: 512 -CLIENTMEM = 512 # Minimum: 256 -# Prefixes for MAC and IP addresses. -MACPREFIX = "08:00:27:0E:65" -NETPREFIX = "192.168.2" -# OpenGnsys Server IP address. -SERVERIP = "#{NETPREFIX}.10" -# Local port to access OpenGnsys Server. -LOCALWEBPORT = 8443 - -# OpenGnsys Server provisioning script: prepare repo disk, install OpenGnsys, change default interface, configure DHCP server. -OGSERVERSCRIPT = <> /etc/fstab - mount -a -fi -# Install OpenGnsys and change server address. -if which curl &>/dev/null; then - DOWNLOAD="curl -s" -elif which wget &>/dev/null; then - DOWNLOAD="wget -q -O -" -fi -BRANCH="opengnsys-#{OGVERSION}" -$DOWNLOAD "https://raw.githubusercontent.com/opengnsys/OpenGnsys/$BRANCH/installer/opengnsys_installer.sh" | bash || exit $? -mv /opt/opengnsys/log/bash.log /opt/opengnsys/log/opengnsys_installer.log -echo y | /opt/opengnsys/bin/setserveraddr $(ip -o link show | tail -1 | cut -d: -f2) -# Insert DHCP data. -for ((i=#{NCLIENTS+10}; i>10; i--)); do - sed -i "/^}$/ i host pc${i} { hardware ethernet #{MACPREFIX}:${i}; fixed-address #{NETPREFIX}.${i}; }" /etc/dhcp/dhcpd.conf -done -service isc-dhcp-server restart -# Set language. -export LANG="#{LANGUAGE}.UTF-8" -echo "LANG=\\\"$LANG\\\"" > /etc/default/locale -echo "LANG=\\\"$LANG\\\"" >> /etc/environment -locale-gen --lang #{LANGUAGE} -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" -#for ((i=11; i<=#{NCLIENTS+10}; i++)); do -# SQL="$SQL ('pc$i', '#{NETPREFIX}.$i', REPLACE('#{MACPREFIX}$i',':',''), 1, 1, 0, 0, 0, 0, '#{NETPREFIX}.1', '255.255.255.0', '00unknown', 'eth0', 'generic', 'fotoordenador.gif')," -#done -#mysql -u usuog -ppassusuog -D ogAdmBD -e "${SQL%,}" -#/opt/opengnsys/bin/setclientmode ogLiveAdmin pc11 PERM -#for ((i=12; i<=#{NCLIENTS+10}; i++)); do -# /opt/opengnsys/bin/setclientmode ogLive pc$i PERM -#done -echo "Notes:" -echo "- OpenGnsys Server URL: https://localhost:#{LOCALWEBPORT}/opengnsys/" -exit 0 -EOT - -# Client 1 OS provisioning script. -MODELSCRIPT = <> /etc/fstab + mount -a +fi +# Install OpenGnsys and change server address. +if which curl &>/dev/null; then + DOWNLOAD="curl -s" +elif which wget &>/dev/null; then + DOWNLOAD="wget -q -O -" +fi +BRANCH="opengnsys-#{OGVERSION}" +$DOWNLOAD "https://raw.githubusercontent.com/opengnsys/OpenGnsys/$BRANCH/installer/opengnsys_installer.sh" | bash || exit $? +mv /opt/opengnsys/log/bash.log /opt/opengnsys/log/opengnsys_installer.log +echo y | /opt/opengnsys/bin/setserveraddr $(ip -o link show | tail -1 | cut -d: -f2) +# Insert DHCP data. +for ((i=#{NCLIENTS+10}; i>10; i--)); do + sed -i "/^}$/ i host pc${i} { hardware ethernet #{MACPREFIX}:${i}; fixed-address #{NETPREFIX}.${i}; }" /etc/dhcp/dhcpd.conf +done +service isc-dhcp-server restart +# Set language. +export LANG="#{LANGUAGE}.UTF-8" +echo "LANG=\\\"$LANG\\\"" > /etc/default/locale +echo "LANG=\\\"$LANG\\\"" >> /etc/environment +locale-gen --lang #{LANGUAGE} +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" +#for ((i=11; i<=#{NCLIENTS+10}; i++)); do +# SQL="$SQL ('pc$i', '#{NETPREFIX}.$i', REPLACE('#{MACPREFIX}$i',':',''), 1, 1, 0, 0, 0, 0, '#{NETPREFIX}.1', '255.255.255.0', '00unknown', 'eth0', 'generic', 'fotoordenador.gif')," +#done +#mysql -u usuog -ppassusuog -D ogAdmBD -e "${SQL%,}" +#/opt/opengnsys/bin/setclientmode ogLiveAdmin pc11 PERM +#for ((i=12; i<=#{NCLIENTS+10}; i++)); do +# /opt/opengnsys/bin/setclientmode ogLive pc$i PERM +#done +echo "Notes:" +echo "- OpenGnsys Server URL: https://localhost:#{LOCALWEBPORT}/opengnsys/" +exit 0 +EOT + +# Client 1 OS provisioning script. +MODELSCRIPT = < Date: Mon, 15 Jun 2020 09:43:19 +0200 Subject: #983: Avoid error messages in some Cron scripts. --- repoman/bin/deletepreimage | 26 ++++++++------------------ repoman/bin/torrent-tracker | 3 +-- 2 files changed, 9 insertions(+), 20 deletions(-) diff --git a/repoman/bin/deletepreimage b/repoman/bin/deletepreimage index 19d6f2c7..faeb8e58 100755 --- a/repoman/bin/deletepreimage +++ b/repoman/bin/deletepreimage @@ -21,34 +21,24 @@ LOGFILE="$OPENGNSYS/log/$PROG.log" # Procesar ficheros de imágenes. trap 'echo "`date` : Proceso interrumpido" >> $LOGFILE; exit ' 1 2 3 6 9 15 -#TODO en LOCAL: si existe algún fichero *.delete lo movemos al repositorio -ls $OPENGNSYS/www/tmp/*.delete &>/dev/null || (checkrepo; exit) -mv $OPENGNSYS/www/tmp/*.* $OGIMG +shopt -s nullglob +TODELETE=( $OPENGNSYS/www/tmp/*.delete ) -#TODO: iniciar blucle siempre y cuando haya algun delete -ls /opt/opengnsys/images/*.delete &>/dev/null || exit -for IMG in `ls $OGIMG/*.delete`; do +for IMG in ${TODELETE[@]##*/}; do # Obtenemos el nombre de la imagen - DELETEIMAGE=$(echo ${IMG%%.*} | awk -F"$OGIMG/" '{print $2}') - - # Borramos marca .delete para que el próximo cron no trabaje sobre este conjunto. - [ -f $IMG ] && rm $IMG - - ## Comprobamos si es una imagen de backup - DELETEant=$(echo $IMG | awk -F"." '{print $3}') ## .ant - + DELETEIMAGE="${IMG%%.*}" ## Si la imagen es un backup se añade la extensión ant - if [[ $DELETEant == "ant" ]]; then - DELETEIMAGE=$DELETEIMAGE".ant" - fi + [ "${IMG##*.}" == "ant" ] && DELETEIMAGE+=".ant" + ## si directorio:imagen cambiamos : por / DELETEIMAGE=$(echo $DELETEIMAGE|tr : /) ## se llama al escript de borrado de imagen. deleteimage $DELETEIMAGE - done +# Eliminar marcas de borrado. +rm -f ${TODELETE[@]} # Actualizar información del repositorio. checkrepo diff --git a/repoman/bin/torrent-tracker b/repoman/bin/torrent-tracker index 7a0ac7ae..36f8b192 100755 --- a/repoman/bin/torrent-tracker +++ b/repoman/bin/torrent-tracker @@ -16,7 +16,6 @@ BTSEEDERPID="/var/run/btseeder.pid" ################### ####################################### pkill bttrack -rm $BTTRACKDFILE +rm -f $BTTRACKDFILE sleep 2 bttrack $BTTRACK_OPTIONS &>> $BTTRACKLOG & -ps aux | grep bttrack | grep -v grep | awk -F: '{print $3}' -- cgit v1.2.3-18-g5258