mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-05-26 02:24:44 +00:00
add ensure_whiptail function
This is required as some arm64 systems will not have whiptail installed, as it is not installed by default.
This commit is contained in:
+1
-2
@@ -2939,6 +2939,7 @@ install_script() {
|
|||||||
pve_check
|
pve_check
|
||||||
shell_check
|
shell_check
|
||||||
root_check
|
root_check
|
||||||
|
ensure_whiptail
|
||||||
arch_check
|
arch_check
|
||||||
ssh_check
|
ssh_check
|
||||||
maxkeys_check
|
maxkeys_check
|
||||||
@@ -5074,8 +5075,6 @@ create_lxc_container() {
|
|||||||
msg_ok "Downloaded ARM64 LXC template"
|
msg_ok "Downloaded ARM64 LXC template"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Architecture-aware template download wrapper.
|
|
||||||
# Optional $1 overrides destination path (for local-storage fallback).
|
|
||||||
download_template() {
|
download_template() {
|
||||||
local dest="${1:-$TEMPLATE_PATH}"
|
local dest="${1:-$TEMPLATE_PATH}"
|
||||||
if [[ "$ARCH" == "arm64" ]]; then
|
if [[ "$ARCH" == "arm64" ]]; then
|
||||||
|
|||||||
@@ -1718,6 +1718,25 @@ function get_lxc_ip() {
|
|||||||
export LOCAL_IP
|
export LOCAL_IP
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
# ensure_whiptail()
|
||||||
|
#
|
||||||
|
# - Ensures whiptail is installed
|
||||||
|
# - Some ARM64 systems will not have whiptail installed.
|
||||||
|
# - Exits with error message if installation fails
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
ensure_whiptail() {
|
||||||
|
command -v whiptail >/dev/null 2>&1 && return 0
|
||||||
|
|
||||||
|
msg_info "Installing whiptail"
|
||||||
|
apt_update_safe
|
||||||
|
$STD apt-get install -y whiptail || {
|
||||||
|
msg_error "Failed to install whiptail"
|
||||||
|
exit 115
|
||||||
|
}
|
||||||
|
msg_ok "Installed whiptail"
|
||||||
|
}
|
||||||
|
|
||||||
# ==============================================================================
|
# ==============================================================================
|
||||||
# SIGNAL TRAPS
|
# SIGNAL TRAPS
|
||||||
# ==============================================================================
|
# ==============================================================================
|
||||||
|
|||||||
Reference in New Issue
Block a user