From baaa70e9c8257833d4fc7de992ea393ce6532ce4 Mon Sep 17 00:00:00 2001 From: spiritLHLS <103393591+spiritLHLS@users.noreply.github.com> Date: Wed, 15 Feb 2023 15:22:58 +0800 Subject: [PATCH] Update install_iso.sh --- install_iso.sh | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/install_iso.sh b/install_iso.sh index aff063c..5bd2d02 100644 --- a/install_iso.sh +++ b/install_iso.sh @@ -1,10 +1,28 @@ #!/bin/bash #from https://github.com/spiritLHLS/pve +echo "请选择要下载到的模板目录:" +echo "1. Proxmox VE 的模板目录(/var/lib/vz/template/iso/)" +echo "2. LXC 的模板目录(/var/lib/lxc/template/iso/)" +read -p "请输入选项编号(1或2): " choice + # 下载Ubuntu和Debian的最新系统镜像 wget -P /root/ https://cloud-images.ubuntu.com/focal/current/focal-server-cloudimg-amd64.img wget -P /root/ https://github.com/spiritLHLS/pve/releases/download/debian-11.6.0-amd64-netinst.iso/debian-11.6.0-amd64-netinst.iso # 将镜像文件移动到Proxmox VE的模板目录中 -mv /root/focal-server-cloudimg-amd64.img /var/lib/vz/template/iso/ -mv /root/debian-11.6.0-amd64-netinst.iso /var/lib/vz/template/iso/ +case "$choice" in + 1) + mv /root/focal-server-cloudimg-amd64.img /var/lib/vz/template/iso/ + mv /root/debian-11.6.0-amd64-netinst.iso /var/lib/vz/template/iso/ + echo "已将镜像文件移动到 Proxmox VE 的模板目录" + ;; + 2) + mv /root/focal-server-cloudimg-amd64.img /var/lib/lxc/template/iso/ + mv /root/debian-11.6.0-amd64-netinst.iso /var/lib/lxc/template/iso/ + echo "已将镜像文件移动到 LXC 的模板目录" + ;; + *) + echo "无效的选项,程序退出" + ;; +esac