From a6a08af55182004b2765056ed13d73f2361f2c9a Mon Sep 17 00:00:00 2001 From: Ing Date: Fri, 26 Jul 2024 15:25:20 +0800 Subject: [PATCH] mdoify dialog maxxy --- files/initrd/opt/rr/menu.sh | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/files/initrd/opt/rr/menu.sh b/files/initrd/opt/rr/menu.sh index 015f03bf..3c9c2e46 100755 --- a/files/initrd/opt/rr/menu.sh +++ b/files/initrd/opt/rr/menu.sh @@ -897,10 +897,8 @@ function cmdlineMenu() { while read -r line; do LINENUM=$((LINENUM + 1 + ${#line} / 96)); done <<<"$(printf "${MSG}")" # When the width is 100, each line displays 96 characters. LINENUM=$((${LINENUM:-0} + 9)) # When there are 2 parameters, 9 is the minimum value to include 1 line of MSG. - dialog --print-maxsize 2>"${TMP_PATH}/maxsize" - DIALOG_MAXX=$(cat "${TMP_PATH}/maxsize" 2>/dev/null | grep "MaxSize" | awk -F: '{print $2}' | cut -d, -f2 | xargs) - DIALOG_MAXY=$(cat "${TMP_PATH}/maxsize" 2>/dev/null | grep "MaxSize" | awk -F: '{print $2}' | cut -d, -f1 | xargs) - + DIALOG_MAXX=$(ttysize 2>/dev/null | awk '{print $1}') + DIALOG_MAXY=$(ttysize 2>/dev/null | awk '{print $2}') if [ ${LINENUM:-0} -ge ${DIALOG_MAXY:-0} ]; then MSG="$(TEXT "Please enter the parameter key and value you need to add.\n")" LINENUM=9 @@ -1044,10 +1042,8 @@ function synoinfoMenu() { while read -r line; do LINENUM=$((LINENUM + 1 + ${#line} / 96)); done <<<"$(printf "${MSG}")" # When the width is 100, each line displays 96 characters. LINENUM=$((${LINENUM:-0} + 9)) # When there are 2 parameters, 9 is the minimum value to include 1 line of MSG. - dialog --print-maxsize 2>"${TMP_PATH}/maxsize" - DIALOG_MAXX=$(cat "${TMP_PATH}/maxsize" 2>/dev/null | grep "MaxSize" | awk -F: '{print $2}' | cut -d, -f2 | xargs) - DIALOG_MAXY=$(cat "${TMP_PATH}/maxsize" 2>/dev/null | grep "MaxSize" | awk -F: '{print $2}' | cut -d, -f1 | xargs) - + DIALOG_MAXX=$(ttysize 2>/dev/null | awk '{print $1}') + DIALOG_MAXY=$(ttysize 2>/dev/null | awk '{print $2}') if [ ${LINENUM:-0} -ge ${DIALOG_MAXY:-0} ]; then MSG="$(TEXT "Please enter the parameter key and value you need to add.\n")" LINENUM=9