Changes to bridge detection ProxmoxVE/#4413

This commit is contained in:
Michel Roegl-Brunner 2025-05-12 15:53:35 +02:00
parent eeb72893c3
commit b4ead14854

View File

@ -440,8 +440,7 @@ advanced_settings() {
# 1. Find all lines starting with 'iface' and store their line numbers
# 2. Get the total number of lines in the file
# 3. Use awk to create line ranges for each iface section (start:end)
( 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}"
# Check if the indexes file exists, hence has been created
if [ -f "${iface_indexes_tmpfile}" ]; then