From 4cced72bbb7c8ce9130267cc20769a9736893638 Mon Sep 17 00:00:00 2001 From: AuxXxilium Date: Thu, 31 Oct 2024 12:27:42 +0100 Subject: [PATCH] arc: fix logic Signed-off-by: AuxXxilium --- files/initrd/opt/arc/arc-functions.sh | 7 +++++-- files/initrd/opt/arc/arc.sh | 29 ++++++++++++++++++--------- 2 files changed, 25 insertions(+), 11 deletions(-) diff --git a/files/initrd/opt/arc/arc-functions.sh b/files/initrd/opt/arc/arc-functions.sh index 55c0a837..5557b6c6 100755 --- a/files/initrd/opt/arc/arc-functions.sh +++ b/files/initrd/opt/arc/arc-functions.sh @@ -61,12 +61,15 @@ function addonSelection() { dialog --backtitle "$(backtitlep)" --title "DSM Addons" --colors --aspect 18 \ --checklist "Select DSM Addons to include.\nAddons: \Z1System Addon\Zn | \Z4App Addon\Zn\nSelect with SPACE, Confirm with ENTER!" 0 0 0 \ --file "${TMP_PATH}/opts" 2>"${TMP_PATH}/resp" + [ $? -ne 0 ] && return 1 + resp=$(cat ${TMP_PATH}/resp) else dialog --backtitle "$(backtitle)" --title "DSM Addons" --colors --aspect 18 \ --checklist "Select DSM Addons to include.\nAddons: \Z1System Addon\Zn | \Z4App Addon\Zn\nSelect with SPACE, Confirm with ENTER!" 0 0 0 \ --file "${TMP_PATH}/opts" 2>"${TMP_PATH}/resp" - [ $? -ne 0 ] && return 1 - resp=$(cat ${TMP_PATH}/resp) + [ $? -ne 0 ] && return 1 + resp=$(cat ${TMP_PATH}/resp) + fi unset ADDONS declare -A ADDONS writeConfigKey "addons" "{}" "${USER_CONFIG_FILE}" diff --git a/files/initrd/opt/arc/arc.sh b/files/initrd/opt/arc/arc.sh index 24596c5d..05f0f0e9 100755 --- a/files/initrd/opt/arc/arc.sh +++ b/files/initrd/opt/arc/arc.sh @@ -435,15 +435,26 @@ function arcPatch() { writeConfigKey "arc.patch" "false" "${USER_CONFIG_FILE}" fi elif [ "${ARCMODE}" == "config" ]; then - dialog --clear --backtitle "$(backtitlep)" \ - --nocancel --title "SN/Mac Options"\ - --menu "Choose an Option." 7 60 0 \ - 1 "Use Arc Patch (AME, QC, Push Notify and more)" \ - 2 "Use random SN/Mac (Reduced DSM Features)" \ - 3 "Use my own SN/Mac (Be sure your Data is valid)" \ - 2>"${TMP_PATH}/resp" - resp=$(cat ${TMP_PATH}/resp) - [ -z "${resp}" ] && return 1 + if [ -n "${ARCCONF}" ]; then + dialog --clear --backtitle "$(backtitlep)" \ + --nocancel --title "SN/Mac Options"\ + --menu "Choose an Option." 7 60 0 \ + 1 "Use Arc Patch (AME, QC, Push Notify and more)" \ + 2 "Use random SN/Mac (Reduced DSM Features)" \ + 3 "Use my own SN/Mac (Be sure your Data is valid)" \ + 2>"${TMP_PATH}/resp" + resp=$(cat ${TMP_PATH}/resp) + [ -z "${resp}" ] && return 1 + else + dialog --clear --backtitle "$(backtitlep)" \ + --nocancel --title "SN/Mac Options"\ + --menu "Choose an Option." 7 60 0 \ + 2 "Use random SN/Mac (Reduced DSM Features)" \ + 3 "Use my own SN/Mac (Be sure your Data is valid)" \ + 2>"${TMP_PATH}/resp" + resp=$(cat ${TMP_PATH}/resp) + [ -z "${resp}" ] && return 1 + fi if [ ${resp} -eq 1 ]; then [ -z "${ARCCONF}" ] && decryptMenu || true if [ -n "${ARCCONF}" ]; then