Merge pull request #19 from AuxXxilium/dev

arc-c: fix update
This commit is contained in:
Christian 2024-03-29 12:32:19 +01:00 committed by GitHub
commit f646e84cfd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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
}