From 28df568d8cb91ca7b76b294be5a8f1a1ff31d4b6 Mon Sep 17 00:00:00 2001 From: AuxXxilium Date: Tue, 4 Feb 2025 16:56:15 +0100 Subject: [PATCH] tree: fix logic Signed-off-by: AuxXxilium --- files/initrd/opt/arc/arc-functions.sh | 10 +++++----- files/initrd/opt/arc/boot.sh | 2 +- files/initrd/opt/arc/include/consts.sh | 4 ++-- files/initrd/opt/arc/include/functions.sh | 18 ++++++++++-------- 4 files changed, 18 insertions(+), 16 deletions(-) diff --git a/files/initrd/opt/arc/arc-functions.sh b/files/initrd/opt/arc/arc-functions.sh index c7576a7b..284f2e2c 100755 --- a/files/initrd/opt/arc/arc-functions.sh +++ b/files/initrd/opt/arc/arc-functions.sh @@ -1003,7 +1003,7 @@ function cmdlineMenu() { 2>"${TMP_PATH}/resp" RET=$? case ${RET} in - 0) # ok-button + 0) NAME="$(sed -n '1p' "${TMP_PATH}/resp" 2>/dev/null)" VALUE="$(sed -n '2p' "${TMP_PATH}/resp" 2>/dev/null)" [[ "${NAME}" = *= ]] && NAME="${NAME%?}" @@ -1016,11 +1016,11 @@ function cmdlineMenu() { writeConfigKey "cmdline.\"${NAME//\"/}\"" "${VALUE}" "${USER_CONFIG_FILE}" break ;; - 1) # cancel-button + 1) break ;; - 255) # ESC - # break + 255) + break ;; esac done @@ -1036,7 +1036,7 @@ function cmdlineMenu() { done < <(readConfigMap "cmdline" "${USER_CONFIG_FILE}") if [ ${#CMDLINE[@]} -eq 0 ]; then dialog --backtitle "$(backtitle)" --msgbox "No user cmdline to remove" 0 0 - continue + break fi ITEMS="" for I in "${!CMDLINE[@]}"; do diff --git a/files/initrd/opt/arc/boot.sh b/files/initrd/opt/arc/boot.sh index 27a323f4..a0914e43 100755 --- a/files/initrd/opt/arc/boot.sh +++ b/files/initrd/opt/arc/boot.sh @@ -313,7 +313,7 @@ elif [ "${DIRECTBOOT}" = "false" ]; then fi # Wait for boot interrupt - # _bootwait || true + _bootwait || true for T in $(busybox w 2>/dev/null | grep -v 'TTY' | awk '{print $2}'); do if [ -w "/dev/${T}" ]; then diff --git a/files/initrd/opt/arc/include/consts.sh b/files/initrd/opt/arc/include/consts.sh index ad7ebcd5..d623766b 100755 --- a/files/initrd/opt/arc/include/consts.sh +++ b/files/initrd/opt/arc/include/consts.sh @@ -47,6 +47,6 @@ EXTRACTOR_BIN="syno_extract_system_patch" HTTPPORT=$(grep -i '^HTTP_PORT=' /etc/arc.conf 2>/dev/null | cut -d'=' -f2) [ -z "${HTTPPORT}" ] && HTTPPORT="" || true DUFSPORT=$(grep -i '^DUFS_PORT=' /etc/arc.conf 2>/dev/null | cut -d'=' -f2) -[ -z "${DUFSPORT}" ] && DUFSPORT=7304 || true +[ -z "${DUFSPORT}" ] && DUFSPORT="7304" || true TTYDPORT=$(grep -i '^TTYD_PORT=' /etc/arc.conf 2>/dev/null | cut -d'=' -f2) -[ -z "${TTYDPORT}" ] && TTYDPORT=7681 || true \ No newline at end of file +[ -z "${TTYDPORT}" ] && TTYDPORT="7681" || true \ No newline at end of file diff --git a/files/initrd/opt/arc/include/functions.sh b/files/initrd/opt/arc/include/functions.sh index 200c165b..18aa26a6 100755 --- a/files/initrd/opt/arc/include/functions.sh +++ b/files/initrd/opt/arc/include/functions.sh @@ -615,13 +615,15 @@ function onlineCheck() { writeConfigKey "keymap" "${KEYMAP}" "${USER_CONFIG_FILE}" fi fi - NEWTAG="$(curl -m 10 -skL "https://api.github.com/repos/AuxXxilium/arc/releases" | jq -r ".[].tag_name" | grep -v "dev" | sort -rV | head -1)" - if [ -n "${NEWTAG}" ]; then - writeConfigKey "arc.offline" "false" "${USER_CONFIG_FILE}" - updateOffline - checkHardwareID - else - writeConfigKey "arc.offline" "true" "${USER_CONFIG_FILE}" + if [ "${ARC_BRANCH}" != "dev" ]; then + NEWTAG="$(curl -m 10 -skL "https://api.github.com/repos/AuxXxilium/arc/releases" | jq -r ".[].tag_name" | grep -v "dev" | sort -rV | head -1)" + if [ -n "${NEWTAG}" ]; then + writeConfigKey "arc.offline" "false" "${USER_CONFIG_FILE}" + updateOffline + checkHardwareID + else + writeConfigKey "arc.offline" "true" "${USER_CONFIG_FILE}" + fi fi } @@ -701,7 +703,7 @@ function __umountDSMRootDisk() { # bootwait SSH/Web function _bootwait() { BOOTWAIT="$(readConfigKey "bootwait" "${USER_CONFIG_FILE}")" - [ -z "${BOOTWAIT}" ] && BOOTWAIT=10 + [ -z "${BOOTWAIT}" ] && BOOTWAIT="5" busybox w 2>/dev/null | awk '{print $1" "$2" "$4" "$5" "$6}' >WB MSG="" while [ ${BOOTWAIT} -gt 0 ]; do