diff --git a/files/initrd/opt/arc/arc.sh b/files/initrd/opt/arc/arc.sh index 464a623..768e432 100755 --- a/files/initrd/opt/arc/arc.sh +++ b/files/initrd/opt/arc/arc.sh @@ -102,34 +102,34 @@ function updateMenu() { fi if [ "${ACTUALVERSION}" = "${TAG}" ]; then arcModel - exit 0 - fi - 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-c-${TAG}.img.zip" -o "${TMP_PATH}/arc-c-${TAG}.img.zip") - if [[ $? -ne 0 || ${STATUS} -ne 200 ]]; then + else dialog --backtitle "$(backtitle)" --title "Upgrade Loader" --aspect 18 \ - --infobox "Error downloading Updatefile!\nUse current Version." 0 0 - sleep 5 - arcModel - exit 0 - fi - 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 + --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-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 + exit 0 + fi + 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 + sleep 5 + arcModel + exit 0 + fi dialog --backtitle "$(backtitle)" --title "Upgrade Loader" --aspect 18 \ - --infobox "Error extracting Updatefile!\nUse current Version." 0 0 - sleep 5 - arcModel - exit 0 + --infobox "Installing new Loader Image" 0 0 + # 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 + exec reboot fi - dialog --backtitle "$(backtitle)" --title "Upgrade Loader" --aspect 18 \ - --infobox "Installing new Loader Image" 0 0 - # 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 - exec reboot exit 0 } diff --git a/files/initrd/opt/arc/boot.sh b/files/initrd/opt/arc/boot.sh index 8399205..1d10ff5 100755 --- a/files/initrd/opt/arc/boot.sh +++ b/files/initrd/opt/arc/boot.sh @@ -53,7 +53,7 @@ PRODUCTVER="$(readConfigKey "productver" "${USER_CONFIG_FILE}")" LKM="$(readConfigKey "lkm" "${USER_CONFIG_FILE}")" MACSYS="$(readConfigKey "arc.macsys" "${USER_CONFIG_FILE}")" CPU="$(echo $(cat /proc/cpuinfo 2>/dev/null | grep 'model name' | uniq | awk -F':' '{print $2}'))" -RAMTOAL=$(($(free -m | grep -i mem | awk '{print$2}') / 1024 + 1)) +RAMTOTAL=$(($(free -m | grep -i mem | awk '{print$2}') / 1024 + 1)) RAM="${RAMTOTAL}GB" VENDOR="$(dmesg 2>/dev/null | grep -i "DMI:" | sed 's/\[.*\] DMI: //i')" @@ -235,7 +235,7 @@ elif [ "${DIRECTBOOT}" = "false" ]; then echo -e "\033[1;37m"Booting DSM..."\033[0m" for T in $(w | grep -v "TTY" | awk -F' ' '{print $2}') do - echo -e "\n\033[1;37mThis interface will not be operational. Wait a few minutes.\033[0m\n Use \033[1;34mhttp://${IPCON}:5000\033[0m or try \033[1;34mhttp://find.synology.com/ \033[0mto find DSM and proceed.\n" >"/dev/${T}" 2>/dev/null || true + echo -e "\n\033[1;37mThis interface will not be operational. Wait a few minutes.\033[0m\nUse \033[1;34mhttp://${IPCON}:5000\033[0m or try \033[1;34mhttp://find.synology.com/ \033[0mto find DSM and proceed.\n" >"/dev/${T}" 2>/dev/null || true done # Clear logs for dbgutils addons