Files
1Panel/agent/utils/vm/helper/prepare.sh
ssongliu c06c4e338b feat(vm): enable community virtual machines and migrate xpack data (#14279)
* 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
2026-11-02 18:22:58 +08:00

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