refs #649 adds the id of the oglive to the install return from oglivecli

ogboot_debian_installer
Luis Gerardo Romero Garcia 2024-09-06 09:28:47 +00:00
parent 0120a101ab
commit 92b058532e
1 changed files with 9 additions and 1 deletions

View File

@ -349,14 +349,22 @@ function install() {
# Confirmar y eliminar el archivo ISO
sudo rm -f "$OGLIVEFILE"
# Obtener el checksum desde el archivo ogclient.sqfs.sum en el directorio $OGLIVEDIR
CHECKSUM_FILE="$OGLIVEDIR/ogclient.sqfs.sum"
if [ -f "$CHECKSUM_FILE" ]; then
OGLIVEID=$(cat "$CHECKSUM_FILE")
else
OGLIVEID="N/A" # Si no existe el archivo, asignamos un valor por defecto
fi
JSON_OUTPUT=$(jq -n \
--arg id "$OGLIVEID" \
--arg dist "$OGLIVEDIST" \
--arg krnl "$OGLIVEKRNL" \
--arg arch "$OGLIVEARCH" \
--arg rev "$OGLIVEREV" \
--arg dir "$OGLIVEDIR" \
--arg iso "$(basename "$OGLIVEFILE")" \
'{status: "success", messages: [], result: {distribution: $dist, kernel: $krnl, architecture: $arch, revision: $rev, directory: $dir, iso: $iso}}')
'{status: "success", messages: [], result: {id: $id, distribution: $dist, kernel: $krnl, architecture: $arch, revision: $rev, directory: $dir, iso: $iso}}')
echo "$JSON_OUTPUT"
}