Update build.func

This commit is contained in:
CanbiZ 2024-12-09 09:57:47 +01:00
parent 63be70cc25
commit 29209dbee6

View File

@ -575,42 +575,33 @@ 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)
# 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
header_info
while true; do
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)
CHOICE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "SETTINGS" --menu "Choose an option:" \
12 50 4 \
"1" "Default Settings" \
"2" "Default Settings (with verbose)" \
"3" "Advanced Settings" \
"4" "Exit" 3>&1 1>&2 2>&3)
if [ $? -ne 0 ]; then
echo -e "${CROSS}${RD} Menu canceled. Exiting.${CL}"
exit 1
fi
case $CHOICE in
1)
1)
header_info
echo -e "${DEFAULT}${BOLD}${BL}Using Default Settings${CL}"
VERB="no"
@ -618,32 +609,31 @@ install_script() {
echo_default
break
;;
2)
2)
header_info
echo -e "${DEFAULT}${BOLD}${BL}Using Default Settings (Verbose)${CL}"
echo -e "${DEFAULT}${BOLD}${BL}Using Default Settings (${SEARCH} Verbose)${CL}"
VERB="yes"
base_settings
echo_default
break
;;
3)
3)
header_info
echo -e "${ADVANCED}${BOLD}${RD}Using Advanced Settings${CL}"
advanced_settings
break
;;
4)
echo -e "${CROSS}${RD} Exiting.${CL}"
4)
echo -e "${CROSS}${RD}Exiting.${CL}"
exit 0
;;
*)
echo -e "${CROSS}${RD} Invalid option, please try again.${CL}"
*)
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}')