📝 Add complete guide for Connect block hostname escape fix

This commit is contained in:
mihaiitdata 2026-02-23 23:40:39 +02:00
parent 93130083a5
commit 50bc955986
2 changed files with 3 additions and 7 deletions

View File

View File

@ -1277,13 +1277,9 @@ Operator {
# Generare CONNECT section pentru link server-to-server (independent de HUB/LEAF)
if [ "$hub_config" = "yes" ]; then
# Escape-uim caracterele speciale pentru sed
hub_name_escaped=$(printf '%s\n' "$hub_name" | sed 's:[][\/.^$*]:\\&:g')
hub_host_escaped=$(printf '%s\n' "$hub_host" | sed 's:[][\/.^$*]:\\&:g')
hub_pass_escaped=$(printf '%s\n' "$hub_pass" | sed 's:[][\/.^$*|]:\\&:g')
# Generăm blocul Connect folosind awk pentru înlocuire sigură
awk -v name="$hub_name_escaped" -v host="$hub_host_escaped" -v pass="$hub_pass_escaped" -v port="$hub_port" '
# Generăm blocul Connect folosind awk (NU escape-uim hostname-urile!)
# awk gestionează automat caracterele speciale în variabile -v
awk -v name="$hub_name" -v host="$hub_host" -v pass="$hub_pass" -v port="$hub_port" '
/EOFCONFIG_HUB_CONNECT/ {
print "# Conectare server-to-server"
print "Connect {"