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