From 9f2f6e60968880bb23c57b2d59895c0455d00304 Mon Sep 17 00:00:00 2001 From: Ing Date: Tue, 18 Jun 2024 21:17:27 +0800 Subject: [PATCH] fix w output format caused by abnormal interruption --- files/initrd/opt/rr/boot.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/files/initrd/opt/rr/boot.sh b/files/initrd/opt/rr/boot.sh index cdf9f65d..ceb813cf 100755 --- a/files/initrd/opt/rr/boot.sh +++ b/files/initrd/opt/rr/boot.sh @@ -247,12 +247,12 @@ else done BOOTWAIT="$(readConfigKey "bootwait" "${USER_CONFIG_FILE}")" [ -z "${BOOTWAIT}" ] && BOOTWAIT=10 - w -h 2>/dev/null | awk '{print $1" "$2" "$3}' >WB + w -h 2>/dev/null | grep -v tty1 | awk '{print $1" "$2" "$3}' >WB MSG="" while test ${BOOTWAIT} -ge 0; do MSG="$(printf "\033[1;33m$(TEXT "%2ds (Changing access(ssh/web) status will interrupt boot)")\033[0m" "${BOOTWAIT}")" echo -en "\r${MSG}" - w -h 2>/dev/null | awk '{print $1" "$2" "$3}' >WC + w -h 2>/dev/null | grep -v tty1 | awk '{print $1" "$2" "$3}' >WC if ! diff WB WC >/dev/null 2>&1; then echo -en "\r\033[1;33m$(TEXT "access(ssh/web) status has changed and booting is interrupted.")\033[0m\n" rm -f WB WC