Skip to content
This repository has been archived by the owner on May 8, 2024. It is now read-only.

Commit

Permalink
Merge pull request #271 from fbelavenuto/update
Browse files Browse the repository at this point in the history
More tests
  • Loading branch information
fbelavenuto authored Oct 26, 2022
2 parents cbc5507 + 649b594 commit 02563f4
Showing 1 changed file with 13 additions and 16 deletions.
29 changes: 13 additions & 16 deletions files/board/arpl/overlayfs/opt/arpl/menu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -889,35 +889,32 @@ function updateMenu() {
fi
dialog --backtitle "`backtitle`" --title "Update arpl" --aspect 18 \
--infobox "Downloading last version ${TAG}" 0 0
# Download checksum
STATUS=`curl --insecure -s -w "%{http_code}" -L "https://github.com/fbelavenuto/arpl/releases/download/${TAG}/sha256sum" -o /tmp/sha256sum`
# Download update file
STATUS=`curl --insecure -s -w "%{http_code}" -L "https://github.com/fbelavenuto/arpl/releases/download/${TAG}/update-${TAG}.zip" -o /tmp/update.zip`
if [ $? -ne 0 -o ${STATUS} -ne 200 ]; then
dialog --backtitle "`backtitle`" --title "Update arpl" --aspect 18 \
--msgbox "Error downloading checksums" 0 0
--msgbox "Error downloading update file" 0 0
continue
fi
STATUS=`curl --insecure -s -w "%{http_code}" -L "https://github.com/fbelavenuto/arpl/releases/download/${TAG}/bzImage" -o /tmp/bzImage`
if [ $? -ne 0 -o ${STATUS} -ne 200 ]; then
dialog --backtitle "`backtitle`" --title "Update arpl" --aspect 18 \
--msgbox "Error downloading bzImage" 0 0
continue
fi
STATUS=`curl --insecure -s -w "%{http_code}" -L "https://github.com/fbelavenuto/arpl/releases/download/${TAG}/rootfs.cpio.xz" -o /tmp/rootfs.cpio.xz`
if [ $? -ne 0 -o ${STATUS} -ne 200 ]; then
unzip /tmp/update.zip -d /tmp
if [ $? -ne 0 ]; then
dialog --backtitle "`backtitle`" --title "Update arpl" --aspect 18 \
--msgbox "Error downloading rootfs.cpio.xz" 0 0
--msgbox "Error extracting update file" 0 0
continue
fi
dialog --backtitle "`backtitle`" --title "Update arpl" --aspect 18 \
--infobox "Installing new files" 0 0
# Check checksums
(cd /tmp && sha256sum --status -c sha256sum)
if [ $? -ne 0 ]; then
dialog --backtitle "`backtitle`" --title "Update arpl" --aspect 18 \
--msgbox "Checksum do not match!" 0 0
continue
fi
mv /tmp/bzImage "${ARPL_BZIMAGE_FILE}"
mv /tmp/rootfs.cpio.xz "${ARPL_RAMDISK_FILE}"
dialog --backtitle "`backtitle`" --title "Update arpl" --aspect 18 \
--infobox "Installing new files" 0 0
# Process update-list.yml
while IFS="=" read KEY VALUE; do
mv /tmp/`basename "${KEY}"` "${VALUE}"
done < <(readConfigMap "replace" "/tmp/update-list.yml")
dialog --backtitle "`backtitle`" --title "Update arpl" --aspect 18 \
--yesno "Arpl updated with success to ${TAG}!\nReboot?" 0 0
[ $? -ne 0 ] && continue
Expand Down

0 comments on commit 02563f4

Please sign in to comment.