Update build.func

This commit is contained in:
CanbiZ 2025-06-19 17:01:09 +02:00
parent e162830c33
commit f9d1d8e143

View File

@ -482,56 +482,52 @@ advanced_settings() {
fi fi
done done
if DISK_SIZE=$(whiptail --backtitle "[dev] Proxmox VE Helper Scripts" --inputbox "Set Disk Size in GB" 8 58 "$var_disk" --title "DISK SIZE" 3>&1 1>&2 2>&3); then while true; do
DISK_SIZE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --inputbox "Set Disk Size in GB" 8 58 "$var_disk" --title "DISK SIZE" 3>&1 1>&2 2>&3) || exit_script
if [ -z "$DISK_SIZE" ]; then if [ -z "$DISK_SIZE" ]; then
DISK_SIZE="$var_disk" DISK_SIZE="$var_disk"
fi fi
if ! [[ "$DISK_SIZE" =~ ^[1-9][0-9]*$ ]]; then if [[ "$DISK_SIZE" =~ ^[1-9][0-9]*$ ]]; then
clear echo -e "${DISKSIZE}${BOLD}${DGN}Disk Size: ${BGN}${DISK_SIZE} GB${CL}"
echo -e "${HOLD}${RD}DISK SIZE MUST BE A POSITIVE INTEGER!${CL}" break
sleep 2 else
advanced_settings whiptail --msgbox "Disk size must be a positive integer!" 8 58
fi fi
done
echo -e "${DISKSIZE}${BOLD}${DGN}Disk Size: ${BGN}${DISK_SIZE} GB${CL}" while true; do
else CORE_COUNT=$(whiptail --backtitle "Proxmox VE Helper Scripts" \
exit_script --inputbox "Allocate CPU Cores" 8 58 "$var_cpu" --title "CORE COUNT" 3>&1 1>&2 2>&3) || exit_script
fi
if CORE_COUNT=$(whiptail --backtitle "[dev] Proxmox VE Helper Scripts" --inputbox "Allocate CPU Cores" 8 58 "$var_cpu" --title "CORE COUNT" 3>&1 1>&2 2>&3); then
if [ -z "$CORE_COUNT" ]; then if [ -z "$CORE_COUNT" ]; then
CORE_COUNT="$var_cpu" CORE_COUNT="$var_cpu"
fi fi
if ! [[ "$CORE_COUNT" =~ ^[1-9][0-9]*$ ]]; then if [[ "$CORE_COUNT" =~ ^[1-9][0-9]*$ ]]; then
clear echo -e "${CPUCORE}${BOLD}${DGN}CPU Cores: ${BGN}$CORE_COUNT${CL}"
echo -e "${HOLD}${RD}CORE COUNT MUST BE A POSITIVE INTEGER!${CL}" break
sleep 2 else
advanced_settings whiptail --msgbox "CPU core count must be a positive integer!" 8 58
fi fi
done
echo -e "${CPUCORE}${BOLD}${DGN}CPU Cores: ${BGN}$CORE_COUNT${CL}" while true; do
else RAM_SIZE=$(whiptail --backtitle "Proxmox VE Helper Scripts" \
exit_script --inputbox "Allocate RAM in MiB" 8 58 "$var_ram" --title "RAM" 3>&1 1>&2 2>&3) || exit_script
fi
if RAM_SIZE=$(whiptail --backtitle "[dev] Proxmox VE Helper Scripts" --inputbox "Allocate RAM in MiB" 8 58 "$var_ram" --title "RAM" 3>&1 1>&2 2>&3); then
if [ -z "$RAM_SIZE" ]; then if [ -z "$RAM_SIZE" ]; then
RAM_SIZE="$var_ram" RAM_SIZE="$var_ram"
fi fi
if ! [[ "$RAM_SIZE" =~ ^[1-9][0-9]*$ ]]; then if [[ "$RAM_SIZE" =~ ^[1-9][0-9]*$ ]]; then
clear echo -e "${RAMSIZE}${BOLD}${DGN}RAM Size: ${BGN}${RAM_SIZE} MiB${CL}"
echo -e "${HOLD}${RD}RAM SIZE MUST BE A POSITIVE INTEGER!${CL}" break
sleep 2 else
advanced_settings whiptail --msgbox "RAM size must be a positive integer!" 8 58
fi fi
done
echo -e "${RAMSIZE}${BOLD}${DGN}RAM Size: ${BGN}${RAM_SIZE} MiB${CL}"
else
exit_script
fi
IFACE_FILEPATH_LIST="/etc/network/interfaces"$'\n'$(find "/etc/network/interfaces.d/" -type f) IFACE_FILEPATH_LIST="/etc/network/interfaces"$'\n'$(find "/etc/network/interfaces.d/" -type f)
BRIDGES="" BRIDGES=""