diff --git a/misc/build.func b/misc/build.func index e1f4ba3b..b764fbd1 100644 --- a/misc/build.func +++ b/misc/build.func @@ -46,11 +46,9 @@ error_handler() { if [[ -n "$CT_ID" ]]; then read -p "Remove this Container? " prompt if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then - pct stop "$CTID" &> /dev/null - pct destroy "$CTID" &> /dev/null + pct stop "$CT_ID" &> /dev/null + pct destroy "$CT_ID" &> /dev/null msg_ok "Removed this Container" - else - msg_warn "Did not remove this Container" fi fi } @@ -322,6 +320,7 @@ EOF 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 <"$FILEPATH" # ${NSAPP} Configuration File # Generated on $(date) @@ -490,12 +489,10 @@ advanced_settings() { BRIDGES="" OLD_IFS=$IFS IFS=$'\n' - echo $IFACE_FILEPATH_LIST for iface_filepath in ${IFACE_FILEPATH_LIST}; do - echo -e "${INFO}${BOLD}${GN}Searching for bridges in ${iface_filepath}${CL}" iface_indexes_tmpfile=$(mktemp -q -u '.iface-XXXX') - ( grep -Pn '^\s*iface' "${iface_filepath}" | cut -d':' -f1 && wc -l "${iface_filepath}" | cut -d' ' -f1 ) | awk 'FNR==1 {line=$0; next} {print line":"$0-1; line=$0}' > "${iface_indexes_tmpfile}" + ( grep -Pn '^\s*iface' "${iface_filepath}" | cut -d':' -f1 && wc -l "${iface_filepath}" | cut -d' ' -f1 ) | awk 'FNR==1 {line=$0; next} {print line":"$0-1; line=$0}' > "${iface_indexes_tmpfile}" || true if [ -f "${iface_indexes_tmpfile}" ]; then @@ -912,7 +909,7 @@ config_file() { for iface_filepath in ${IFACE_FILEPATH_LIST}; do iface_indexes_tmpfile=$(mktemp -q -u '.iface-XXXX') - ( grep -Pn '^\s*iface' "${iface_filepath}" | cut -d':' -f1 && wc -l "${iface_filepath}" | cut -d' ' -f1 ) | awk 'FNR==1 {line=$0; next} {print line":"$0-1; line=$0}' > "${iface_indexes_tmpfile}" + ( grep -Pn '^\s*iface' "${iface_filepath}" | cut -d':' -f1 && wc -l "${iface_filepath}" | cut -d' ' -f1 ) | awk 'FNR==1 {line=$0; next} {print line":"$0-1; line=$0}' > "${iface_indexes_tmpfile}" || true if [ -f "${iface_indexes_tmpfile}" ]; then