Update build.func

This commit is contained in:
Michel Roegl-Brunner 2025-01-28 09:29:38 +01:00
parent 00cd62fc38
commit c04ec818fe

View File

@ -1,6 +1,7 @@
# Copyright (c) 2021-2025 tteck # Copyright (c) 2021-2025 tteck
# Author: tteck (tteckster) # Author: tteck (tteckster)
# Co-Author: MickLesk # Co-Author: MickLesk
# Co-Author: michelroegl-brunner
# License: MIT # License: MIT
# https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE # https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
@ -9,6 +10,7 @@ variables() {
var_install="${NSAPP}-install" # sets the var_install variable by appending "-install" to the value of NSAPP. var_install="${NSAPP}-install" # sets the var_install variable by appending "-install" to the value of NSAPP.
INTEGER='^[0-9]+([.][0-9]+)?$' # it defines the INTEGER regular expression pattern. INTEGER='^[0-9]+([.][0-9]+)?$' # it defines the INTEGER regular expression pattern.
PVEHOST_NAME=$(hostname) # gets the Proxmox Hostname and sets it to Uppercase PVEHOST_NAME=$(hostname) # gets the Proxmox Hostname and sets it to Uppercase
DIAGNOSTICS="yes" # sets the DIAGNOSTICS variable to "yes", used for the API call.
} }
# This function sets various color variables using ANSI escape codes for formatting text in the terminal. # This function sets various color variables using ANSI escape codes for formatting text in the terminal.
@ -824,7 +826,8 @@ post_to_api() {
"core_count": $CORE_COUNT, "core_count": $CORE_COUNT,
"ram_size": $RAM_SIZE, "ram_size": $RAM_SIZE,
"verbose": "$VERBOSE", "verbose": "$VERBOSE",
"ct_id": $CT_ID, "os_type": "$var_os",
"os_version": "$var_version",
"hn": "$HN", "hn": "$HN",
"disableip6": "$DISABLEIP6", "disableip6": "$DISABLEIP6",
"ssh": "$SSH", "ssh": "$SSH",
@ -858,6 +861,11 @@ install_script() {
timezone=$(cat /etc/timezone) timezone=$(cat /etc/timezone)
header_info header_info
while true; do while true; do
if ! (whiptail --backtitle "Proxmox VE Helper Scripts" --title "DIAGNOSTICS" --yesno "Send diagnostics to the maintainer? (No User Data!)" 10 58); then
DIAGNOSTICS="no"
fi
CHOICE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "SETTINGS" --menu "Choose an option:" \ CHOICE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "SETTINGS" --menu "Choose an option:" \
12 50 4 \ 12 50 4 \
"1" "Default Settings" \ "1" "Default Settings" \
@ -972,7 +980,10 @@ build_container() {
else else
FEATURES="nesting=1" FEATURES="nesting=1"
fi fi
post_to_api
if [[ $DIAGNOSTICS == "yes" ]]; then
post_to_api
fi
TEMP_DIR=$(mktemp -d) TEMP_DIR=$(mktemp -d)
pushd $TEMP_DIR >/dev/null pushd $TEMP_DIR >/dev/null