From 46db33e6f37958c3db2a9d813bd3a9427ddb0883 Mon Sep 17 00:00:00 2001 From: Ing Date: Sat, 3 May 2025 21:09:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20resizeImg=20=E5=87=BD?= =?UTF-8?q?=E6=95=B0=E4=B8=AD=E7=9A=84=E6=96=87=E4=BB=B6=E6=9F=A5=E6=89=BE?= =?UTF-8?q?=E9=80=BB=E8=BE=91=EF=BC=8C=E4=BD=BF=E7=94=A8=20find=20?= =?UTF-8?q?=E6=9B=BF=E4=BB=A3=20ls=20=E4=BB=A5=E6=8F=90=E9=AB=98=E5=87=86?= =?UTF-8?q?=E7=A1=AE=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/func.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/func.sh b/scripts/func.sh index 5225f96f..bbd7e2fc 100755 --- a/scripts/func.sh +++ b/scripts/func.sh @@ -317,8 +317,8 @@ function resizeImg() { local LOOPX LOOPX=$(sudo losetup -f) sudo losetup -P "${LOOPX}" "${OUTPUT_FILE}" - sudo e2fsck -fp "$(ls ${LOOPX}* 2>/dev/null | sort -n | tail -1)" - sudo resize2fs "$(ls ${LOOPX}* 2>/dev/null | sort -n | tail -1)" + sudo e2fsck -fp "$(find "${LOOPX}p"* -maxdepth 0 2>/dev/null | sort -n | tail -1)" + sudo resize2fs "$(find "${LOOPX}p"* -maxdepth 0 2>/dev/null | sort -n | tail -1)" sudo losetup -d "${LOOPX}" }