mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-08-10 22:59:16 +02:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 63a91c8d93 | |||
| 590d638094 | |||
| fb1d670158 |
+2
-2
@@ -925,7 +925,7 @@ _list_os_versions() {
|
||||
local arch
|
||||
arch="$(dpkg --print-architecture 2>/dev/null || echo amd64)"
|
||||
pveam available -section system 2>/dev/null |
|
||||
grep -E "_${arch}\.(tar\.zst|tar\.xz|tar\.gz)$" |
|
||||
grep -E "_${arch}\.(tar\.zst|tar\.xz|tar\.gz)([[:space:]]|$)" |
|
||||
awk '{print $2}' |
|
||||
sed -nE "s/^${ostype}-([0-9]+(\.[0-9]+)?).*/\1/p" |
|
||||
sort -u -V || true
|
||||
@@ -941,7 +941,7 @@ _list_templates() {
|
||||
local arch
|
||||
arch="$(dpkg --print-architecture 2>/dev/null || echo amd64)"
|
||||
pveam available -section system 2>/dev/null |
|
||||
grep -E "_${arch}\.(tar\.zst|tar\.xz|tar\.gz)$" |
|
||||
grep -E "_${arch}\.(tar\.zst|tar\.xz|tar\.gz)([[:space:]]|$)" |
|
||||
awk '{print $2}' |
|
||||
grep -E "^${search}.*${pattern}" |
|
||||
sort -t - -k 2 -V || true
|
||||
|
||||
+29
-28
@@ -2576,11 +2576,6 @@ _deploy_unpacked_archive() {
|
||||
local archive="$1" target="$2" workdir="$3"
|
||||
local filename="${archive##*/}"
|
||||
|
||||
mkdir -p "$target"
|
||||
if [[ "${CLEAN_INSTALL:-0}" == "1" ]]; then
|
||||
find "${target:?}" -mindepth 1 -delete
|
||||
fi
|
||||
|
||||
if [[ "$filename" == *.zip ]]; then
|
||||
ensure_dependencies unzip
|
||||
unzip -q "$archive" -d "$workdir" || {
|
||||
@@ -2607,38 +2602,44 @@ _deploy_unpacked_archive() {
|
||||
return 65
|
||||
fi
|
||||
|
||||
local top_entries inner_dir
|
||||
local top_entries inner_dir source_dir
|
||||
top_entries=$(find "$workdir" -mindepth 1 -maxdepth 1)
|
||||
if [[ "$(echo "$top_entries" | wc -l)" -eq 1 && -d "$top_entries" ]]; then
|
||||
inner_dir="$top_entries"
|
||||
shopt -s dotglob nullglob
|
||||
if compgen -G "$inner_dir/*" >/dev/null; then
|
||||
cp -r "$inner_dir"/* "$target/" || {
|
||||
msg_error "Failed to copy contents from $inner_dir to $target"
|
||||
shopt -u dotglob nullglob
|
||||
return 252
|
||||
}
|
||||
else
|
||||
msg_error "Inner directory is empty: $inner_dir"
|
||||
shopt -u dotglob nullglob
|
||||
return 252
|
||||
fi
|
||||
shopt -u dotglob nullglob
|
||||
source_dir="$inner_dir"
|
||||
else
|
||||
shopt -s dotglob nullglob
|
||||
if compgen -G "$workdir/*" >/dev/null; then
|
||||
cp -r "$workdir"/* "$target/" || {
|
||||
msg_error "Failed to copy contents to $target"
|
||||
shopt -u dotglob nullglob
|
||||
return 252
|
||||
}
|
||||
source_dir="$workdir"
|
||||
fi
|
||||
|
||||
shopt -s dotglob nullglob
|
||||
if ! compgen -G "$source_dir/*" >/dev/null; then
|
||||
if [[ -n "$inner_dir" ]]; then
|
||||
msg_error "Inner directory is empty: $inner_dir"
|
||||
else
|
||||
msg_error "Unpacked archive is empty"
|
||||
shopt -u dotglob nullglob
|
||||
return 252
|
||||
fi
|
||||
shopt -u dotglob nullglob
|
||||
return 252
|
||||
fi
|
||||
|
||||
# <target> is only touched once the payload is known good. Wiping earlier left
|
||||
# CLEAN_INSTALL callers with an empty target directory whenever the download
|
||||
# was truncated, the archive was unreadable, or it unpacked to nothing.
|
||||
mkdir -p "$target"
|
||||
if [[ "${CLEAN_INSTALL:-0}" == "1" ]]; then
|
||||
find "${target:?}" -mindepth 1 -delete
|
||||
fi
|
||||
|
||||
if ! cp -r "$source_dir"/* "$target/"; then
|
||||
if [[ -n "$inner_dir" ]]; then
|
||||
msg_error "Failed to copy contents from $inner_dir to $target"
|
||||
else
|
||||
msg_error "Failed to copy contents to $target"
|
||||
fi
|
||||
shopt -u dotglob nullglob
|
||||
return 252
|
||||
fi
|
||||
shopt -u dotglob nullglob
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
@@ -125,12 +125,6 @@ EOF
|
||||
no) msg_error "Selected no to Correcting Proxmox VE Sources" ;;
|
||||
esac
|
||||
|
||||
if [[ "$(dpkg --print-architecture 2>/dev/null)" == "arm64" ]]; then
|
||||
msg_ok "ARM64 detected - skipping Proxmox repository setup"
|
||||
post_routines_common
|
||||
return
|
||||
fi
|
||||
|
||||
CHOICE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "PVE-ENTERPRISE" --menu "The 'pve-enterprise' repository is only available to users who have purchased a Proxmox VE subscription.\n \nDisable 'pve-enterprise' repository?" 14 58 2 \
|
||||
"yes" " " \
|
||||
"no" " " 3>&2 2>&1 1>&3)
|
||||
@@ -288,12 +282,6 @@ EOF
|
||||
esac
|
||||
fi
|
||||
|
||||
if [[ "$(dpkg --print-architecture 2>/dev/null)" == "arm64" ]]; then
|
||||
msg_ok "ARM64 detected - skipping Proxmox repository setup"
|
||||
post_routines_common
|
||||
return
|
||||
fi
|
||||
|
||||
# ---- PVE-ENTERPRISE ----
|
||||
if component_exists_in_sources "pve-enterprise"; then
|
||||
CHOICE=$(whiptail --backtitle "Proxmox VE Helper Scripts" \
|
||||
|
||||
Reference in New Issue
Block a user