update: fix output

Signed-off-by: AuxXxilium <info@auxxxilium.tech>
This commit is contained in:
AuxXxilium 2024-08-14 19:14:14 +02:00
parent 4f981aea94
commit c7d29e79ba

View File

@ -176,13 +176,13 @@ function updateLoader() {
mv -f "${TMP_PATH}/bzImage-arc" "${ARC_BZIMAGE_FILE}"
mv -f "${TMP_PATH}/initrd-arc" "${ARC_RAMDISK_FILE}"
rm -f "${TMP_PATH}/update.zip"
echo "Update done!"
sleep 2
else
echo "Error getting new Version!"
sleep 5
updateFailed
fi
echo "Update done!"
sleep 2
) 2>&1 | dialog --backtitle "$(backtitle)" --title "Update Loader" \
--progressbox "Updating Loader..." 20 70
fi
@ -247,13 +247,13 @@ function updateAddons() {
tar -xaf "${F}" -C "${ADDONS_PATH}/${ADDON}"
rm -f "${F}"
done
echo "Update done!"
sleep 2
else
echo "Error extracting new Version!"
sleep 5
updateFailed
fi
echo "Update done!"
sleep 2
) 2>&1 | dialog --backtitle "$(backtitle)" --title "Update Addons" \
--progressbox "Updating Addons..." 20 70
fi
@ -310,13 +310,13 @@ function updatePatches() {
echo "Installing new Patches..."
unzip -oq "${TMP_PATH}/patches.zip" -d "${PATCH_PATH}"
rm -f "${TMP_PATH}/patches.zip"
echo "Update done!"
sleep 2
else
echo "Error extracting new Version!"
sleep 5
updateFailed
fi
echo "Update done!"
sleep 2
) 2>&1 | dialog --backtitle "$(backtitle)" --title "Update Patches" \
--progressbox "Updating Patches..." 20 70
fi
@ -373,13 +373,13 @@ function updateCustom() {
echo "Installing new Custom Kernel..."
unzip -oq "${TMP_PATH}/custom.zip" -d "${CUSTOM_PATH}"
rm -f "${TMP_PATH}/custom.zip"
echo "Update done!"
sleep 2
else
echo "Error extracting new Version!"
sleep 5
updateFailed
fi
echo "Update done!"
sleep 2
) 2>&1 | dialog --backtitle "$(backtitle)" --title "Update Custom" \
--progressbox "Updating Custom..." 20 70
fi
@ -455,13 +455,13 @@ function updateModules() {
writeConfigKey "modules.${ID}" "" "${USER_CONFIG_FILE}"
done < <(getAllModules "${PLATFORM}" "${KVERP}")
fi
echo "Update done!"
sleep 2
else
echo "Error extracting new Version!"
sleep 5
updateFailed
fi
echo "Update done!"
sleep 2
) 2>&1 | dialog --backtitle "$(backtitle)" --title "Update Modules" \
--progressbox "Updating Modules..." 20 70
fi
@ -494,7 +494,6 @@ function updateConfigs() {
(
# Download update file
local URL="https://github.com/AuxXxilium/arc-configs/releases/download/${TAG}/configs.zip"
local SHA="https://github.com/AuxXxilium/arc-configs/releases/download/${TAG}/checksum.sha256"
echo "Downloading ${TAG}"
if [ "${ARCNIC}" == "auto" ]; then
curl -#kL "${URL}" -o "${TMP_PATH}/configs.zip" 2>&1 | while IFS= read -r -n1 char; do
@ -502,31 +501,30 @@ function updateConfigs() {
[[ $char == % ]] && echo "Download: $progress%" && progress="" && keep=0 ;
[[ $keep == 1 ]] && progress="$progress$char" ;
done
curl -skL "${SHA}" -o "${TMP_PATH}/checksum.sha256"
else
curl --interface ${ARCNIC} -#kL "${URL}" -o "${TMP_PATH}/configs.zip" 2>&1 | while IFS= read -r -n1 char; do
[[ $char =~ [0-9] ]] && keep=1 ;
[[ $char == % ]] && echo "Download: $progress%" && progress="" && keep=0 ;
[[ $keep == 1 ]] && progress="$progress$char" ;
done
curl --interface ${ARCNIC} -skL "${SHA}" -o "${TMP_PATH}/checksum.sha256"
fi
if [ "$(sha256sum "${TMP_PATH}/configs.zip" | awk '{print $1}')" = "$(cat ${TMP_PATH}/checksum.sha256 | awk '{print $1}')" ]; then
if [ -f "${TMP_PATH}/configs.zip" ]; then
echo "Download successful!"
rm -rf "${MODEL_CONFIG_PATH}"
mkdir -p "${MODEL_CONFIG_PATH}"
echo "Installing new Configs..."
unzip -oq "${TMP_PATH}/configs.zip" -d "${MODEL_CONFIG_PATH}"
rm -f "${TMP_PATH}/configs.zip"
echo "Update done!"
sleep 2
else
echo "Error extracting new Version!"
sleep 5
updateFailed
fi
echo "Update done!"
sleep 2
) 2>&1 | dialog --backtitle "$(backtitle)" --title "Update Configs" \
--progressbox "Updating Configs..." 20 70
writeConfigKey "arc.key" "" "${USER_CONFIG_FILE}"
fi
return 0
}
@ -578,13 +576,13 @@ function updateLKMs() {
echo "Installing new LKMs..."
unzip -oq "${TMP_PATH}/rp-lkms.zip" -d "${LKMS_PATH}"
rm -f "${TMP_PATH}/rp-lkms.zip"
echo "Update done!"
sleep 2
else
echo "Error extracting new Version!"
sleep 5
updateFailed
fi
echo "Update done!"
sleep 2
) 2>&1 | dialog --backtitle "$(backtitle)" --title "Update LKMs" \
--progressbox "Updating LKMs..." 20 70
fi