From f3dfd62c16d14a8b57fb22030c42e755a6fa8421 Mon Sep 17 00:00:00 2001 From: Michel Roegl-Brunner Date: Fri, 16 May 2025 08:55:05 +0200 Subject: [PATCH 1/3] Changes to build.func --- misc/build.func | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/build.func b/misc/build.func index e1f4ba3b..fd9f8dca 100644 --- a/misc/build.func +++ b/misc/build.func @@ -495,7 +495,7 @@ advanced_settings() { 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 From b9af9155eae96f3e300bb2ea6eca4c9659fdab7c Mon Sep 17 00:00:00 2001 From: Michel Roegl-Brunner Date: Fri, 16 May 2025 08:55:56 +0200 Subject: [PATCH 2/3] Changes to build.func --- misc/build.func | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/misc/build.func b/misc/build.func index fd9f8dca..70868279 100644 --- a/misc/build.func +++ b/misc/build.func @@ -46,8 +46,8 @@ 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" From 01702a24fec758c29051b48b8b474254f7bfa94b Mon Sep 17 00:00:00 2001 From: Michel Roegl-Brunner Date: Fri, 16 May 2025 09:02:33 +0200 Subject: [PATCH 3/3] Cleanup --- misc/build.func | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/misc/build.func b/misc/build.func index 70868279..b764fbd1 100644 --- a/misc/build.func +++ b/misc/build.func @@ -49,8 +49,6 @@ error_handler() { 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,10 +489,8 @@ 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}" || true @@ -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