pve/install_iso.sh

44 lines
2.4 KiB
Bash
Raw Normal View History

2023-02-15 12:38:01 +08:00
#!/bin/bash
#from https://github.com/spiritLHLS/pve
2023-02-15 15:22:58 +08:00
echo "请选择要下载到的模板目录:"
echo "1. Proxmox VE 的模板目录(/var/lib/vz/template/iso/"
2023-02-16 21:30:06 +08:00
echo "2. LXC 的模板目录(/var/lib/vz/template/cache/"
2023-02-15 15:24:45 +08:00
echo "3. 全都要"
2023-02-15 15:22:58 +08:00
read -p "请输入选项编号1或2: " choice
2023-02-15 12:38:01 +08:00
# 将镜像文件移动到Proxmox VE的模板目录中
2023-02-15 15:22:58 +08:00
case "$choice" in
1)
2023-02-17 09:41:03 +08:00
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
2023-02-15 15:22:58 +08:00
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)
2023-02-17 09:41:03 +08:00
wget -P /root/ http://download.proxmox.com/images/system/ubuntu-20.04-standard_20.04-1_amd64.tar.gz
wget -P /root/ http://download.proxmox.com/images/system/debian-11-standard_11.3-0_amd64.tar.gz
wget -P /root/ http://download.proxmox.com/images/system/debian-10-standard_10.7-1_amd64.tar.gz
mv /root/ubuntu-20.04-standard_20.04-1_amd64.tar.gz /var/lib/vz/template/cache/
mv /root/debian-11-standard_11.3-0_amd64.tar.gz /var/lib/vz/template/cache/
mv /root/debian-10-standard_10.7-1_amd64.tar.gz /var/lib/vz/template/cache/
2023-02-15 15:22:58 +08:00
echo "已将镜像文件移动到 LXC 的模板目录"
;;
2023-02-15 15:24:45 +08:00
3)
2023-02-17 09:41:03 +08:00
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
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/
wget -P /root/ http://download.proxmox.com/images/system/ubuntu-20.04-standard_20.04-1_amd64.tar.gz
wget -P /root/ http://download.proxmox.com/images/system/debian-11-standard_11.3-0_amd64.tar.gz
wget -P /root/ http://download.proxmox.com/images/system/debian-10-standard_10.7-1_amd64.tar.gz
mv /root/ubuntu-20.04-standard_20.04-1_amd64.tar.gz /var/lib/vz/template/cache/
mv /root/debian-11-standard_11.3-0_amd64.tar.gz /var/lib/vz/template/cache/
mv /root/debian-10-standard_10.7-1_amd64.tar.gz /var/lib/vz/template/cache/
2023-02-15 15:24:45 +08:00
;;
2023-02-15 15:22:58 +08:00
*)
echo "无效的选项,程序退出"
;;
esac