mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2026-11-07 00:05:14 +00:00
* feat(vm): enable community virtual machines and migrate xpack data * fix(vm): stop ISO download polling on failure or cancellation * fix(vm): respect deleteFile when deleting failed ISO imports
21 lines
612 B
Bash
21 lines
612 B
Bash
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
helper_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
mkdir -p "${helper_dir}/bin"
|
|
|
|
for arch in amd64 arm64; do
|
|
target="${helper_dir}/bin/1panel-kvm-${arch}"
|
|
if [ -s "${target}" ]; then
|
|
continue
|
|
fi
|
|
download="${target}.download"
|
|
trap 'rm -f "${download}"' EXIT
|
|
curl --fail --location --retry 3 --connect-timeout 15 --max-time 300 \
|
|
"https://resource.fit2cloud.com/1panel/resource/kvm/1panel-kvm-${arch}" \
|
|
--output "${download}"
|
|
test -s "${download}"
|
|
chmod 755 "${download}"
|
|
mv "${download}" "${target}"
|
|
done
|