From 51974dd95c5d33c9e13e659b4ea102c46659adc6 Mon Sep 17 00:00:00 2001 From: Ing Date: Wed, 17 Sep 2025 17:18:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20pve.sh=20=E8=84=9A?= =?UTF-8?q?=E6=9C=AC=EF=BC=8C=E4=BF=AE=E5=A4=8D=E5=AD=98=E5=82=A8=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/pve.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/pve.sh b/scripts/pve.sh index ce0e8a72..c25cd096 100644 --- a/scripts/pve.sh +++ b/scripts/pve.sh @@ -106,7 +106,7 @@ else if ! command -v unzip >/dev/null 2>&1; then apt-get update >/dev/null 2>&1 && apt-get install -y unzip >/dev/null 2>&1 fi - IMG_FILE=$(unzip -l "/tmp/rr-${TAG}.img.zip" | awk '{print $4}' | grep '\.img$' | head -n 1) + IMG_FILE=$(unzip -l "/tmp/rr-${TAG}.img.zip" | awk '{print $4}' | grep '\.img$' | head -1) if [ -z "${IMG_FILE}" ]; then echo "No img file found in rr-${TAG}.img.zip" exit 1 @@ -147,7 +147,7 @@ if [ "${EFI:-1}" -eq 1 ]; then fi # 导入 RR 镜像 -STORAGE=$(pvesm status -content images | awk 'NR>1 {print $1}') +STORAGE=$(pvesm status -content images | awk 'NR>1 {print $1}' | grep local | tail -1) if [ -z "${STORAGE}" ]; then echo "No storage for images" qm destroy ${VMID} --purge @@ -205,7 +205,7 @@ fi # 添加 32G 数据盘 qm set ${VMID} --sata1 local-lvm:32 -BRIDGE=$(awk -F: '/^iface vmbr/ {print $1}' /etc/network/interfaces | awk '{print $2}' | head -n 1) +BRIDGE=$(awk -F: '/^iface vmbr/ {print $1}' /etc/network/interfaces | awk '{print $2}' | head -1) if [ -z "${BRIDGE}" ]; then echo "Get bridge failed" qm destroy ${VMID} --purge