From dddb8eb49a16b30b23eb3b9a6ff951142e7c96f9 Mon Sep 17 00:00:00 2001 From: bin456789 Date: Tue, 20 Jun 2023 22:17:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20iso=20=E9=93=BE=E6=8E=A5?= =?UTF-8?q?=E9=AA=8C=E8=AF=81=E5=A4=B1=E8=B4=A5=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reinstall.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/reinstall.sh b/reinstall.sh index d4b8f01..69a38f7 100644 --- a/reinstall.sh +++ b/reinstall.sh @@ -76,7 +76,8 @@ test_url() { # 所以不用mime判断 # https://www.digipres.org/formats/sources/tika/formats/#application/gzip - real_type=$(file -b $tmp_file | cut -d' ' -f1 | tr '[:upper:]' '[:lower:]') + # 有些 file 版本输出的是 # ISO 9660 CD-ROM filesystem data ,要去掉开头的井号 + real_type=$(file -b $tmp_file | sed 's/^# //' | cut -d' ' -f1 | tr '[:upper:]' '[:lower:]') [ -n "$var_to_eval" ] && eval $var_to_eval=$real_type if ! echo $expect_type | grep -wo "$real_type"; then