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