Update build.func
This commit is contained in:
parent
04b8c22124
commit
b12a6f0eac
@ -336,78 +336,6 @@ base_settings() {
|
|||||||
var_version="12"
|
var_version="12"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
write_config() {
|
|
||||||
mkdir -p /opt/community-scripts
|
|
||||||
# This function writes the configuration to a file.
|
|
||||||
if whiptail --backtitle "[dev] 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 <<EOF >"$FILEPATH"
|
|
||||||
# ${NSAPP} Configuration File
|
|
||||||
# Generated on $(date)
|
|
||||||
|
|
||||||
CT_TYPE="${CT_TYPE}"
|
|
||||||
DISK_SIZE="${DISK_SIZE}"
|
|
||||||
CORE_COUNT="${CORE_COUNT}"
|
|
||||||
RAM_SIZE="${RAM_SIZE}"
|
|
||||||
HN="${HN}"
|
|
||||||
BRG="${BRG}"
|
|
||||||
APT_CACHER_IP="${APT_CACHER_IP:-none}"
|
|
||||||
DISABLEIP6="${DISABLEIP6}"
|
|
||||||
PW='${PW:-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}"
|
|
||||||
|
|
||||||
EOF
|
|
||||||
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 "[dev] 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 <<EOF >"$FILEPATH"
|
|
||||||
# ${NSAPP} Configuration File
|
|
||||||
# Generated on $(date)
|
|
||||||
|
|
||||||
CT_TYPE="${CT_TYPE}"
|
|
||||||
DISK_SIZE="${DISK_SIZE}"
|
|
||||||
CORE_COUNT="${CORE_COUNT}"
|
|
||||||
RAM_SIZE="${RAM_SIZE}"
|
|
||||||
HN="${HN}"
|
|
||||||
BRG="${BRG}"
|
|
||||||
APT_CACHER_IP="${APT_CACHER_IP:-none}"
|
|
||||||
DISABLEIP6="${DISABLEIP6}"
|
|
||||||
PW="${PW:-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}"
|
|
||||||
|
|
||||||
EOF
|
|
||||||
echo -e "${INFO}${BOLD}${GN}Writing configuration to ${FILEPATH}${CL}"
|
|
||||||
else
|
|
||||||
echo -e "${INFO}${BOLD}${RD}Configuration file not overwritten${CL}"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# This function displays the default values for various settings.
|
# This function displays the default values for various settings.
|
||||||
echo_default() {
|
echo_default() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user