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() { 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" \ CHOICE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "SETTINGS" --menu "Choose an option:" \
--title "SETTINGS" \ 12 50 4 \
--menu "Choose an option:" \ "1" "Default Settings" \
"$MENU_HEIGHT" "$MENU_WIDTH" "$CHOICE_WIDTH" \ "2" "Default Settings (with verbose)" \
"${MENU_OPTIONS[@]}" 3>&1 1>&2 2>&3) "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 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"
@ -618,32 +609,31 @@ 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 (${SEARCH} Verbose)${CL}"
VERB="yes" VERB="yes"
base_settings base_settings
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}')