Showing 1 changed files with 7 additions and 3 deletions
+7 -3
scripts/sync_local_hosts.sh
@@ -83,6 +83,10 @@ quote_ros() {
83 83
     printf '%s' "$1" | sed 's/\\/\\\\/g; s/"/\\"/g'
84 84
 }
85 85
 
86
+cloak_pattern() {
87
+    printf '=%s' "$1"
88
+}
89
+
86 90
 is_local_jumper() {
87 91
     local host_name
88 92
     host_name="$(hostname -f 2>/dev/null || hostname 2>/dev/null || true)"
@@ -130,7 +134,7 @@ while IFS= read -r line || [[ -n "$line" ]]; do
130 134
         [[ -n "$name" && -n "$target" ]] || die "Invalid CNAME row: $line"
131 135
 
132 136
         printf '%s\n' "$name" >> "$NAMES_FILE"
133
-        printf '%-40s %s\n' "$name" "$target" >> "$CLOAK_ROWS"
137
+        printf '%-40s %s\n' "$(cloak_pattern "$name")" "$target" >> "$CLOAK_ROWS"
134 138
         if [[ "$name" == *.xdev.ro ]]; then
135 139
             printf '%s %s\n' "$name" "$target" >> "$CNAME_VERIFY_ROWS"
136 140
         fi
@@ -157,7 +161,7 @@ while IFS= read -r line || [[ -n "$line" ]]; do
157 161
 
158 162
     for name in $names; do
159 163
         printf '%s\n' "$name" >> "$NAMES_FILE"
160
-        printf '%-40s %s\n' "$name" "$ip" >> "$CLOAK_ROWS"
164
+        printf '%-40s %s\n' "$(cloak_pattern "$name")" "$ip" >> "$CLOAK_ROWS"
161 165
         if [[ "$name" == *.xdev.ro ]]; then
162 166
             printf '%s %s\n' "$name" "$ip" >> "$VERIFY_ROWS"
163 167
         fi
@@ -200,7 +204,7 @@ cp /etc/hosts "/etc/hosts.bak.$stamp"
200 204
 cp /etc/dnscrypt-proxy/cloaking-rules.txt "/etc/dnscrypt-proxy/cloaking-rules.txt.bak.$stamp"
201 205
 
202 206
 awk '
203
-    NR == FNR { names[$1] = 1; next }
207
+    NR == FNR { names[$1] = 1; names["=" $1] = 1; next }
204 208
     /^# BEGIN XDEV LOCAL DNS MANAGED BLOCK/ { in_managed = 1; next }
205 209
     /^# END XDEV LOCAL DNS MANAGED BLOCK/ { in_managed = 0; next }
206 210
     in_managed { next }