From 4da9c5a2ff3614463454c8770f28335439c686aa Mon Sep 17 00:00:00 2001 From: juewuy Date: Thu, 30 Jul 2026 14:45:47 +0800 Subject: [PATCH] =?UTF-8?q?~=E4=BF=AE=E5=A4=8D=E4=B8=8B=E8=BD=BD=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E6=95=B0=E6=8D=AE=E5=BA=93=E6=97=B6=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E8=BE=93=E5=85=A5=E8=B6=85=E8=BF=879=E7=9A=84?= =?UTF-8?q?=E6=95=B0=E5=AD=97=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/menus/9_upgrade.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/menus/9_upgrade.sh b/scripts/menus/9_upgrade.sh index ccc8de72..4ce09ffe 100644 --- a/scripts/menus/9_upgrade.sh +++ b/scripts/menus/9_upgrade.sh @@ -673,12 +673,15 @@ checkcustgeo() { "" | 0) break ;; - [1-99]) - if [ "$num" -le "$(wc -l <"$TMPDIR"/geo.list)" ]; then + *[!0-9]*) + errornum + ;; + *) + if [ "$num" -le "$(wc -l < "$TMPDIR/geo.list")" ]; then geotype=$(sed -n "$num"p "$TMPDIR"/geo.list) - [ -n "$(echo "$geotype" | grep -oiE 'GeoSite.*dat')" ] && geoname=GeoSite.dat - [ -n "$(echo "$geotype" | grep -oiE 'Country.*mmdb')" ] && geoname=Country.mmdb - [ -n "$(echo "$geotype" | grep -oiE '.*(.srs|.mrs)')" ] && geoname=$geotype + echo "$geotype" | grep -qiE 'GeoSite\.dat' && geoname=GeoSite.dat + echo "$geotype" | grep -qiE 'Country\.mmdb' && geoname=Country.mmdb + echo "$geotype" | grep -qiE '\.(srs|mrs)$' && geoname="$geotype" custgeolink=https://github.com/${project}/releases/download/${release_tag}/${geotype} getcustgeo else @@ -686,9 +689,6 @@ checkcustgeo() { break fi ;; - *) - errornum - ;; esac else msg_alert "\033[31m$UPG_CORE_CHECK_FAIL_HINT\033[0m"