diff --git a/misc/build.func b/misc/build.func index 65f912c0d..a24974929 100644 --- a/misc/build.func +++ b/misc/build.func @@ -192,7 +192,6 @@ base_settings() { GATE="" APT_CACHER="" APT_CACHER_IP="" - #DISABLEIP6="no" MTU="" SD="" NS="" @@ -228,7 +227,7 @@ write_config() { if whiptail --backtitle "Proxmox VE Helper Scripts" --defaultno --title "Write configfile" --yesno "Do you want to write the selections to a config file?" 10 60; then FILEPATH="/opt/community-scripts/${NSAPP}.conf" if [[ ! -f $FILEPATH ]]; then - cat <"$FILEPATH" + cat <"$FILEPATH" # ${NSAPP} Configuration File # Generated on $(date) @@ -236,31 +235,37 @@ CT_TYPE="${CT_TYPE}" DISK_SIZE="${DISK_SIZE}" CORE_COUNT="${CORE_COUNT}" RAM_SIZE="${RAM_SIZE}" +VERBOSE="${VERBOSE}" +PW="${PW##-password }" +#CT_ID=$NEXTID HN="${HN}" BRG="${BRG}" +NET="${NET}" +IPV6_METHOD="$IPV6_METHOD" + +# Set this only if using "IPV6_METHOD=static" +#IPV6STATIC="fd00::1234/64" + +GATE="${GATE:-none}" APT_CACHER_IP="${APT_CACHER_IP:-none}" -DISABLEIP6="" -PW='${PW:-none}' +MTU="${MTU:-1500}" +SD="${SD:-none}" +NS="${NS:-none}" +MAC="${MAC:-none}" +VLAN="${VLAN:-none}" SSH="${SSH}" SSH_AUTHORIZED_KEY="${SSH_AUTHORIZED_KEY}" -VERBOSE="${VERBOSE}" TAGS="${TAGS:-none}" -VLAN="${VLAN:-none}" -MTU="${MTU:-1500}" -GATE="${GATE:-none}" -SD="${SD:-none}" -MAC="${MAC:-none}" -NS="${NS:-none}" -NET="${NET}" -FUSE="${ENABLE_FUSE}" - +ENABLE_FUSE="$ENABLE_FUSE" +ENABLE_TUN="$ENABLE_TUN" EOF +fi echo -e "${INFO}${BOLD}${GN}Writing configuration to ${FILEPATH}${CL}" else echo -e "${INFO}${BOLD}${RD}Configuration file already exists at ${FILEPATH}${CL}" if whiptail --backtitle "Proxmox VE Helper Scripts" --defaultno --title "Overwrite configfile" --yesno "Do you want to overwrite the existing config file?" 10 60; then rm -f "$FILEPATH" - cat <"$FILEPATH" + cat <"$FILEPATH" # ${NSAPP} Configuration File # Generated on $(date) @@ -268,24 +273,29 @@ CT_TYPE="${CT_TYPE}" DISK_SIZE="${DISK_SIZE}" CORE_COUNT="${CORE_COUNT}" RAM_SIZE="${RAM_SIZE}" +VERBOSE="${VERBOSE}" +PW="${PW##-password }" +#CT_ID=$NEXTID HN="${HN}" BRG="${BRG}" +NET="${NET}" +IPV6_METHOD="$IPV6_METHOD" + +# Set this only if using "IPV6_METHOD=static" +#IPV6STATIC="fd00::1234/64" + +GATE="${GATE:-none}" APT_CACHER_IP="${APT_CACHER_IP:-none}" -DISABLEIP6="" -PW='${PW:-none}' +MTU="${MTU:-1500}" +SD="${SD:-none}" +NS="${NS:-none}" +MAC="${MAC:-none}" +VLAN="${VLAN:-none}" SSH="${SSH}" SSH_AUTHORIZED_KEY="${SSH_AUTHORIZED_KEY}" -VERBOSE="${VERBOSE}" TAGS="${TAGS:-none}" -VLAN="${VLAN:-none}" -MTU="${MTU:-1500}" -GATE="${GATE:-none}" -SD="${SD:-none}" -MAC="${MAC:-none}" -NS="${NS:-none}" -NET="${NET}" -FUSE="${ENABLE_FUSE}" - +ENABLE_FUSE="$ENABLE_FUSE" +ENABLE_TUN="$ENABLE_TUN" EOF echo -e "${INFO}${BOLD}${GN}Writing configuration to ${FILEPATH}${CL}" else @@ -667,13 +677,6 @@ advanced_settings() { fi fi - # if (whiptail --backtitle "Proxmox VE Helper Scripts" --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then - # DISABLEIP6="yes" - # else - # DISABLEIP6="no" - # fi - # echo -e "${DISABLEIPV6}${BOLD}${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}" - if MTU1=$(whiptail --backtitle "Proxmox VE Helper Scripts" --inputbox "Set Interface MTU Size (leave blank for default [The MTU of your selected vmbr, default is 1500])" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then if [ -z "$MTU1" ]; then MTU1="Default" @@ -815,7 +818,6 @@ DIAGNOSTICS=yes #"ram_size" #"os_type" #"os_version" -#"disableip6" #"nsapp" #"method" #"pve_version" @@ -842,7 +844,6 @@ DIAGNOSTICS=no #"ram_size" #"os_type" #"os_version" -#"disableip6" #"nsapp" #"method" #"pve_version" @@ -1064,7 +1065,6 @@ build_container() { export CACHER="$APT_CACHER" export CACHER_IP="$APT_CACHER_IP" export tz="$timezone" - #export DISABLEIPV6="$DISABLEIP6" export APPLICATION="$APP" export app="$NSAPP" export PASSWORD="$PW" diff --git a/misc/config-file.func b/misc/config-file.func index 5e7d6d7cc..c7eb5eb87 100644 --- a/misc/config-file.func +++ b/misc/config-file.func @@ -446,6 +446,22 @@ config_file() { fi fi + if [[ "$IPV6_METHOD" == "static" ]]; then + if [[ -n "$IPV6STATIC" ]]; then + IP6=",ip6=${IPV6STATIC}" + echo -e "${NETWORK}${BOLD}${DGN}IPv6 Address: ${BGN}${IPV6STATIC}${CL}" + else + msg_error "IPV6_METHOD is set to static but IPV6STATIC is empty" + exit + fi + elif [[ "$IPV6_METHOD" == "auto" ]]; then + IP6=",ip6=auto" + echo -e "${NETWORK}${BOLD}${DGN}IPv6 Address: ${BGN}auto${CL}" + else + IP6="" + echo -e "${NETWORK}${BOLD}${DGN}IPv6 Address: ${BGN}none${CL}" + fi + if [[ -n "${SD-}" ]]; then if [[ "$SD" == "none" ]]; then SD="" @@ -622,6 +638,24 @@ config_file() { echo -e "${FUSE}${BOLD}${DGN}Enable FUSE: ${BGN}$ENABLE_FUSE${CL}" fi + if [[ -n "$ENABLE_TUN" ]]; then + if [[ "$ENABLE_TUN" == "yes" ]]; then + echo -e "${FUSE}${BOLD}${DGN}Enable TUN: ${BGN}Yes${CL}" + elif [[ "$ENABLE_TUN" == "no" ]]; then + echo -e "${FUSE}${BOLD}${DGN}Enable TUN: ${BGN}No${CL}" + else + msg_error "Enable TUN needs to be 'yes' or 'no', was ${ENABLE_TUN}" + exit + fi + else + if (whiptail --backtitle "Proxmox VE Helper Scripts" --defaultno --title "TUN" --yesno "Enable TUN?" 10 58); then + ENABLE_TUN="yes" + else + ENABLE_TUN="no" + fi + echo -e "${FUSE}${BOLD}${DGN}Enable TUN: ${BGN}$ENABLE_TUN${CL}" + fi + if [[ -n "${VERBOSE-}" ]]; then if [[ "$VERBOSE" == "yes" ]]; then echo -e "${SEARCH}${BOLD}${DGN}Verbose Mode: ${BGN}$VERBOSE${CL}"