Update build.func

This commit is contained in:
CanbiZ 2024-12-09 09:50:49 +01:00
parent 02ded1ee47
commit 63be70cc25

View File

@ -575,28 +575,42 @@ advanced_settings() {
}
install_script() {
# Vorbereitende Checks
pve_check
shell_check
root_check
arch_check
ssh_check
# Stoppen des ping-instances Dienstes, falls aktiv
if systemctl is-active -q ping-instances.service; then
systemctl -q stop ping-instances.service
fi
# Initiale Variablen
NEXTID=$(pvesh get /cluster/nextid)
timezone=$(cat /etc/timezone)
header_info
# Optionen für das Menü
MENU_OPTIONS=(
"1" "Default Settings"
"2" "Default Settings (Verbose)"
"3" "Advanced Settings"
"4" "Exit"
)
MENU_HEIGHT=$(( ${#MENU_OPTIONS[@]} / 2 + 7 )) # Höhe basierend auf Anzahl Optionen
MENU_WIDTH=50 # Feste Breite
CHOICE_WIDTH=25 # Breite der Auswahlliste
while true; do
CHOICE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "SETTINGS" --menu "Choose an option:" \
15 60 4 \
"1" "Default Settings" \
"2" "Default Settings (with verbose)" \
"3" "Advanced Settings" \
"4" "Exit" 3>&1 1>&2 2>&3)
CHOICE=$(whiptail --backtitle "Proxmox VE Helper Scripts" \
--title "SETTINGS" \
--menu "Choose an option:" \
"$MENU_HEIGHT" "$MENU_WIDTH" "$CHOICE_WIDTH" \
"${MENU_OPTIONS[@]}" 3>&1 1>&2 2>&3)
case $CHOICE in
1)
1)
header_info
echo -e "${DEFAULT}${BOLD}${BL}Using Default Settings${CL}"
VERB="no"
@ -604,7 +618,7 @@ install_script() {
echo_default
break
;;
2)
2)
header_info
echo -e "${DEFAULT}${BOLD}${BL}Using Default Settings (Verbose)${CL}"
VERB="yes"
@ -612,23 +626,24 @@ install_script() {
echo_default
break
;;
3)
3)
header_info
echo -e "${ADVANCED}${BOLD}${RD}Using Advanced Settings${CL}"
advanced_settings
break
;;
4)
4)
echo -e "${CROSS}${RD} Exiting.${CL}"
exit 0
;;
*)
*)
echo -e "${CROSS}${RD} Invalid option, please try again.${CL}"
;;
esac
done
}
check_container_resources() {
# Check actual RAM & Cores
current_ram=$(free -m | awk 'NR==2{print $2}')