opensuse: 不输入版本号时改成安装 tumbleweed

This commit is contained in:
bin456789 2023-10-22 16:46:51 +08:00
parent fc3d82ab16
commit 1604af1dac
No known key found for this signature in database
GPG Key ID: EE301B386DE6C11B

View File

@ -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