arc-c: fix update

Signed-off-by: AuxXxilium <info@auxxxilium.tech>
This commit is contained in:
AuxXxilium 2024-03-29 12:30:12 +01:00
parent 0cdcc5d34f
commit ff996f9fe5

View File

@ -105,15 +105,15 @@ function updateMenu() {
dialog --backtitle "$(backtitle)" --title "Upgrade Loader" --aspect 18 \
--infobox "Downloading ${TAG}" 0 0
# Download update file
STATUS=$(curl --insecure -s -w "%{http_code}" -L "https://github.com/AuxXxilium/arc-c/releases/download/${TAG}/arc-a-${TAG}.img.zip" -o "${TMP_PATH}/arc-a-${TAG}.img.zip")
STATUS=$(curl --insecure -s -w "%{http_code}" -L "https://github.com/AuxXxilium/arc-c/releases/download/${TAG}/arc-c-${TAG}.img.zip" -o "${TMP_PATH}/arc-c-${TAG}.img.zip")
if [[ $? -ne 0 || ${STATUS} -ne 200 ]]; then
dialog --backtitle "$(backtitle)" --title "Upgrade Loader" --aspect 18 \
--infobox "Error downloading Updatefile!\nUse current Version." 0 0
sleep 5
arcModel
fi
unzip -oq "${TMP_PATH}/arc-a-${TAG}.img.zip" -d "${TMP_PATH}"
rm -f "${TMP_PATH}/arc-a-${TAG}.img.zip"
unzip -oq "${TMP_PATH}/arc-c-${TAG}.img.zip" -d "${TMP_PATH}"
rm -f "${TMP_PATH}/arc-c-${TAG}.img.zip"
if [ $? -ne 0 ]; then
dialog --backtitle "$(backtitle)" --title "Upgrade Loader" --aspect 18 \
--infobox "Error extracting Updatefile!\nUse current Version." 0 0
@ -125,8 +125,6 @@ function updateMenu() {
# Process complete update
umount "${PART1_PATH}" "${PART2_PATH}" "${PART3_PATH}"
dd if="${TMP_PATH}/arc.img" of=$(blkid | grep 'LABEL="ARC3"' | cut -d3 -f1) bs=1M conv=fsync
# Ask for Boot
rm -f "${TMP_PATH}/arc.img"
exec reboot
exit 0
}