From 1604af1dacf0bf3efc84c1268670f8d03aeb50bd Mon Sep 17 00:00:00 2001 From: bin456789 Date: Sun, 22 Oct 2023 16:46:51 +0800 Subject: [PATCH] =?UTF-8?q?opensuse:=20=E4=B8=8D=E8=BE=93=E5=85=A5?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8F=B7=E6=97=B6=E6=94=B9=E6=88=90=E5=AE=89?= =?UTF-8?q?=E8=A3=85=20tumbleweed?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reinstall.sh | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/reinstall.sh b/reinstall.sh index ad65e09..1012e77 100644 --- a/reinstall.sh +++ b/reinstall.sh @@ -549,16 +549,9 @@ verify_os_name() { if [ -n "$finalos" ]; then distro=$(echo $finalos | cut -d: -f1) releasever=$(echo $finalos | cut -d: -f2) - if [ -z "$releasever" ]; then - # 默认版本号 - if grep -q '|' <<<$os; then - if [ "$distro" = opensuse ]; then - field='NF-1' - else - field='NF' - fi - releasever=$(awk '{print $2}' <<<$os | awk -F'|' "{print \$($field)}") - fi + # 默认版本号 + if [ -z "$releasever" ] && grep -q '|' <<<$os; then + releasever=$(awk '{print $2}' <<<$os | awk -F'|' '{print $NF}') fi return fi