arc: rework more

Signed-off-by: AuxXxilium <info@auxxxilium.tech>
This commit is contained in:
AuxXxilium 2024-08-26 13:02:51 -04:00
parent d6609e191c
commit 9f2485ad00
2 changed files with 25 additions and 14 deletions

View File

@ -1,6 +1,8 @@
###############################################################################
# Permits user edit the user config
function editUserConfig() {
OLDMODEL="${MODEL}"
OLDPRODUCTVER="${PRODUCTVER}"
while true; do
dialog --backtitle "$(backtitle)" --title "Edit with caution" \
--ok-label "Save" --editbox "${USER_CONFIG_FILE}" 0 0 2>"${TMP_PATH}/userconfig"
@ -10,8 +12,6 @@ function editUserConfig() {
[ $? -eq 0 ] && break || continue
dialog --backtitle "$(backtitle)" --title "Invalid YAML format" --msgbox "${ERRORS}" 0 0
done
OLDMODEL="${MODEL}"
OLDPRODUCTVER="${PRODUCTVER}"
MODEL="$(readConfigKey "model" "${USER_CONFIG_FILE}")"
PRODUCTVER="$(readConfigKey "productver" "${USER_CONFIG_FILE}")"
SN="$(readConfigKey "sn" "${USER_CONFIG_FILE}")"
@ -72,9 +72,9 @@ function addonSelection() {
done
ADDONSINFO="$(readConfigEntriesArray "addons" "${USER_CONFIG_FILE}")"
if [ "${NANOVER}" == "2" ]; then
ADDONSINFO+="\nWarning: DSM 7.2.2 isn't supported by all Addons!"
ADDONSINFO+="\n\nWARN: DSM 7.2.2 isn't supported by app-specific Addons!"
dialog --backtitle "$(backtitle)" --title "DSM Addons" \
--msgbox "DSM Addons selected:\n${ADDONSINFO}" 10 50
--msgbox "DSM Addons selected:\n${ADDONSINFO}" 10 60
else
dialog --backtitle "$(backtitle)" --title "DSM Addons" \
--msgbox "DSM Addons selected:\n${ADDONSINFO}" 7 50

View File

@ -287,17 +287,28 @@ function arcVersion() {
[ $? -ne 0 ] && return 0
resp=$(cat ${TMP_PATH}/resp)
[ -z "${resp}" ] && return 1
if [ "${PRODUCTVER}" != "${resp}" ]; then
if [ "${resp}" == "7.2" ]; then
dialog --backtitle "$(backtitle)" --title "DSM Version" \
--menu "Choose a DSM Version?\n* Recommended Option" 8 40 0 \
1 "DSM 7.2.1 (Stable) *" \
2 "DSM 7.2.2 (Experimental)" \
2>"${TMP_PATH}/resp"
[ $? -ne 0 ] && return 1
resp=$(cat ${TMP_PATH}/resp)
[ -z "${resp}" ] && return 1
if [ ${resp} -eq 1 ]; then
resp="7.2"
respnano="1"
elif [ ${resp} -eq 2 ]; then
resp="7.2"
respnano="2"
fi
fi
if [ "${PRODUCTVER}" != "${resp}" ] || [ "${NANOVER}" != "${respnano}" ]; then
writeConfigKey "confdone" "false" "${USER_CONFIG_FILE}"
PRODUCTVER="${resp}"
if [ "${PRODUCTVER}" == "7.2.2" ]; then
PRODUCTVER="7.2"
NANOVER="2"
elif [ "${PRODUCTVER}" == "7.2.1" ]; then
PRODUCTVER="7.2"
NANOVER="1"
fi
writeConfigKey "productver" "${PRODUCTVER}" "${USER_CONFIG_FILE}"
NANOVER="${respnano}"
writeConfigKey "nanover" "${NANOVER}" "${USER_CONFIG_FILE}"
# Delete old files
rm -f "${ORI_ZIMAGE_FILE}" "${ORI_RDGZ_FILE}" "${MOD_ZIMAGE_FILE}" "${MOD_RDGZ_FILE}" 2>/dev/null || true
@ -665,8 +676,8 @@ function make() {
# Get PAT Data
dialog --backtitle "$(backtitle)" --colors --title "Arc Build" \
--infobox "Get PAT Data from Local File..." 3 40
PAT_URL="$(readConfigKey "\"${MODEL}\".\"${PRODUCTVER}\".url" "${D_FILE}")"
PAT_HASH="$(readConfigKey "\"${MODEL}\".\"${PRODUCTVER}\".hash" "${D_FILE}")"
PAT_URL="$(readConfigKey "\"${MODEL}\".\"${PRODUCTVER}.${NANOVER}\".url" "${D_FILE}")"
PAT_HASH="$(readConfigKey "\"${MODEL}\".\"${PRODUCTVER}.${NANOVER}\".hash" "${D_FILE}")"
VALID="true"
else
# Get PAT Data