Skip to content

Commit

Permalink
Update and rename build_kvm_images.sh to main.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
spiritLHLS authored Jan 30, 2024
1 parent c95bb75 commit 8086e6f
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions build_kvm_images.sh → main.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
#!/bin/bash
#from https://github.com/oneclickvirt/pve_kvm_images


sudo apt-get install -y libguestfs-tools rng-tools curl
sudo apt-get install -y libguestfs-tools rng-tools curl --fix-missing
curl -o rebuild_qcow2.sh https://raw.githubusercontent.com/oneclickvirt/pve_kvm_images/main/rebuild_qcow2.sh
chmod 777 rebuild_qcow2.sh
links=($(curl -s -m 6 https://down.idc.wiki/Image/realServer-Template/current/qcow2/ | grep -o '<a href="[^"]*">' | awk -F'"' '{print $2}' | sed -n '/qcow2$/s#/Image/realServer-Template/current/qcow2/##p'))
if [ ${#links[@]} -gt 0 ]; then
for link in "${links[@]}"; do
Expand All @@ -10,10 +13,6 @@ if [ ${#links[@]} -gt 0 ]; then
else
echo "没有找到KVM镜像"
fi
sudo apt-get install -y libguestfs-tools rng-tools curl
sudo apt-get install -y libguestfs-tools rng-tools curl --fix-missing
curl -o rebuild_qcow2.sh https://raw.githubusercontent.com/oneclickvirt/pve_kvm_images/main/rebuild_qcow2.sh
chmod 777 rebuild_qcow2.sh
for image in "${links[@]}"; do
curl -o $image "https://down.idc.wiki/Image/realServer-Template/current/qcow2/$image"
chmod 777 $image
Expand Down

0 comments on commit 8086e6f

Please sign in to comment.