From 2fbfef5178fcdaca98e49d2999cae15dd943a170 Mon Sep 17 00:00:00 2001 From: AuxXxilium Date: Sun, 29 Sep 2024 18:30:01 +0200 Subject: [PATCH] restore: rewrite logic Signed-off-by: AuxXxilium --- files/initrd/opt/arc/arc-functions.sh | 6 +++--- files/initrd/opt/arc/arc.sh | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/files/initrd/opt/arc/arc-functions.sh b/files/initrd/opt/arc/arc-functions.sh index 0665dc66..94765ff7 100755 --- a/files/initrd/opt/arc/arc-functions.sh +++ b/files/initrd/opt/arc/arc-functions.sh @@ -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 ;; diff --git a/files/initrd/opt/arc/arc.sh b/files/initrd/opt/arc/arc.sh index 068ab700..8ac02558 100755 --- a/files/initrd/opt/arc/arc.sh +++ b/files/initrd/opt/arc/arc.sh @@ -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" \