refs #1271 modifies install that dont allow download iso when oglive is already installed

pull/7/head
Luis Gerardo Romero Garcia 2025-01-13 10:31:27 +01:00
parent eb3fc2c9d1
commit d8f9ff5523
1 changed files with 14 additions and 0 deletions

View File

@ -139,6 +139,8 @@ function download() {
else
local download_url="$1"
OGLIVEFILE=$(basename "$download_url")
local oglive_name="${OGLIVEFILE%.iso}" # Nombre del ogLive sin la extensión .iso
INSTALLED_PATH="$TFTPDIR/$oglive_name" # Ruta de instalación donde se verifica
# Validar que la URL apunte a un archivo ISO.
if [[ ! "$OGLIVEFILE" =~ \.iso$ ]]; then
@ -148,6 +150,18 @@ function download() {
# Obtener el tamaño de descarga.
SOURCELENGTH=$(curl -k --head --retry 5 --retry-delay 5 --max-time 30 "$download_url" | awk -F: '/Content-Length:/ {print $2}')
[ -n "$SOURCELENGTH" ] || raiseError download "No se pudo obtener el tamaño del archivo desde \"$download_url\"."
# Verificar si el ogLive ya está instalado
if [ -d "$INSTALLED_PATH" ]; then
echo "El ogLive \"$oglive_name\" ya está instalado en \"$INSTALLED_PATH\"."
return 0
fi
# Verificar si el ogLive ya está instalado
echo $INSTALLED_PATH
if [ -d "$INSTALLED_PATH" ]; then
echo "El ogLive \"$oglive_name\" ya está instalado en \"$INSTALLED_PATH\"."
return 0
fi
# Descargar ogLive.
TARGETFILE="$DOWNLOADDIR/$OGLIVEFILE"