restore: rewrite logic

Signed-off-by: AuxXxilium <info@auxxxilium.tech>
This commit is contained in:
AuxXxilium 2024-09-29 18:30:01 +02:00
parent c72a0fd713
commit 2fbfef5178
2 changed files with 4 additions and 3 deletions

View File

@ -682,7 +682,7 @@ function backupMenu() {
NEXT="1"
while true; do
dialog --backtitle "$(backtitle)" --cancel-label "Exit" --menu "Choose an Option" 0 0 0 \
1 "Restore and Build Arc Config from DSM" \
1 "Restore Arc Config from DSM" \
2 "Restore HW Encryption Key from DSM" \
3 "Backup HW Encryption Key to DSM" \
2>"${TMP_PATH}/resp"
@ -740,10 +740,10 @@ function backupMenu() {
done < <(getAllModules "${PLATFORM}" "${KVERP}")
fi
dialog --backtitle "$(backtitle)" --title "Restore Arc Config" \
--aspect 18 --msgbox "Config restore successful!\nBuild now..." 0 0
--aspect 18 --msgbox "Config restore successful!\nDownloading necessary files..." 0 0
sleep 2
ARCMODE="automated"
writeConfigKey "arc.mode" "${ARCMODE}" "${USER_CONFIG_FILE}"
ARCRESTORE="true"
arcVersion
fi
;;

View File

@ -458,6 +458,7 @@ function arcVersion() {
fi
# Cleanup
[ -d "${UNTAR_PAT_PATH}" ] && rm -rf "${UNTAR_PAT_PATH}"
[ "${ARCRESTORE}" == "true" ] && return 0 && ARCRESTORE="false" || true
# Change Config if Files are valid
if [ "${VALID}" == "true" ] && [ -f "${ORI_ZIMAGE_FILE}" ] && [ -f "${ORI_RDGZ_FILE}" ]; then
dialog --backtitle "$(backtitle)" --title "Arc Config" \