diff --git a/misc/build.func b/misc/build.func index bd55da0..f67673e 100644 --- a/misc/build.func +++ b/misc/build.func @@ -2,7 +2,7 @@ # Author: tteck (tteckster) # Co-Author: MickLesk # Co-Author: michelroegl-brunner -# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE variables() { NSAPP=$(echo ${APP,,} | tr -d ' ') # This function sets the NSAPP variable by converting the value of the APP variable to lowercase and removing any spaces. @@ -333,6 +333,7 @@ base_settings() { HN=$NSAPP BRG="vmbr0" NET="dhcp" + IPv6="auto" GATE="" APT_CACHER="" APT_CACHER_IP="" @@ -711,7 +712,25 @@ advanced_settings() { if (whiptail --backtitle "Proxmox VE Helper Scripts" --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then DISABLEIP6="yes" else + IPv6="auto" DISABLEIP6="no" + if IP6=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "IPv6" --inputbox "Enter IPv6 Address (Default SLAAC)" 10 58); then + IPv6=$IP6 + echo -e "${NETWORK}${BOLD}${DGN}IPv6 Address: ${BGN}$IPv6${CL}" + if IP6GW=$(whiptail --backtitle "Proxmox VE Helper Scripts" --inputbox "Enter IPv6 Gateway" 8 58 --title "IPv6 Gateway" 3>&1 1>&2 2>&3); then + if [ -z $IP6GW ]; then + IP6GW="Default" + echo -e "${GATEWAY}${BOLD}${DGN}IPv6 Gateway: ${BGN}$IP6GW${CL}" + else + IPv6GW=",gw6=$IP6GW" + echo -e "${GATEWAY}${BOLD}${DGN}IPv6 Gateway: ${BGN}$IP6GW${CL}" + fi + else + exit_script + fi + else + IPv6="auto" + fi fi echo -e "${DISABLEIPV6}${BOLD}${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}" @@ -837,9 +856,9 @@ diagnostics_check() { DIAGNOSTICS=yes #This file is used to store the diagnostics settings for the Community-Scripts API. -#https://github.com/community-scripts/ProxmoxVED/discussions/1836 +#https://github.com/community-scripts/ProxmoxVE/discussions/1836 #Your diagnostics will be sent to the Community-Scripts API for troubleshooting/statistical purposes. -#You can review the data at https://community-scripts.github.io/ProxmoxVED/data +#You can review the data at https://community-scripts.github.io/ProxmoxVE/data #If you do not wish to send diagnostics, please set the variable 'DIAGNOSTICS' to "no" in /usr/local/community-scripts/diagnostics, or use the menue. #This will disable the diagnostics feature. #To send diagnostics, set the variable 'DIAGNOSTICS' to "yes" in /usr/local/community-scripts/diagnostics, or use the menue. @@ -864,9 +883,9 @@ EOF DIAGNOSTICS=no #This file is used to store the diagnostics settings for the Community-Scripts API. -#https://github.com/community-scripts/ProxmoxVED/discussions/1836 +#https://github.com/community-scripts/ProxmoxVE/discussions/1836 #Your diagnostics will be sent to the Community-Scripts API for troubleshooting/statistical purposes. -#You can review the data at https://community-scripts.github.io/ProxmoxVED/data +#You can review the data at https://community-scripts.github.io/ProxmoxVE/data #If you do not wish to send diagnostics, please set the variable 'DIAGNOSTICS' to "no" in /usr/local/community-scripts/diagnostics, or use the menue. #This will disable the diagnostics feature. #To send diagnostics, set the variable 'DIAGNOSTICS' to "yes" in /usr/local/community-scripts/diagnostics, or use the menue. @@ -1102,7 +1121,9 @@ build_container() { export PCT_OSTYPE="$var_os" export PCT_OSVERSION="$var_version" export PCT_DISK_SIZE="$DISK_SIZE" - export PCT_OPTIONS=" + export IPv6="$IPv6" + if [[ DISABLEIP6 == "yes" ]]; then + export PCT_OPTIONS=" -features $FEATURES -hostname $HN -tags $TAGS @@ -1115,6 +1136,22 @@ build_container() { -unprivileged $CT_TYPE $PW " + else + export PCT_OPTIONS=" + -features $FEATURES + -hostname $HN + -tags $TAGS + $SD + $NS + -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU,ip6=$IPv6$IPv6GW + -onboot 1 + -cores $CORE_COUNT + -memory $RAM_SIZE + -unprivileged $CT_TYPE + $PW + " + fi + # This executes create_lxc.sh and creates the container and .conf file bash -c "$(wget -qLO - https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/ct/create_lxc.sh)" || exit $? @@ -1201,10 +1238,10 @@ description() { spend Coffee

- + - GitHub + GitHub @@ -1250,7 +1287,7 @@ exit_script() { #200 exit codes indicate error in create_lxc.sh #100 exit codes indicate error in install.func - if [ $exit_code -ne 0 ]; then + if [ $exit_code -ne 0 ]; then case $exit_code in 100) post_update_to_api "failed" "100: Unexpected error in create_lxc.sh" ;; 101) post_update_to_api "failed" "101: No network connection detected in create_lxc.sh" ;;