Zuletzt aktiv 1 month ago

Änderung 14f6d7cf72529bed12d7539589066b1178891602

gistfile1.txt Originalformat
1root@wireguard:/etc/wireguard/wgctl# sed -n '/dest_display/,/accept_dest_row/p' \
2 /etc/wireguard/wgctl/commands/activity.command.sh | head -20
3 local dest_display
4 local raw_suffix=""
5 local resolved="${_DEST_RESOLVE_CACHE[$spec]:-${d_ip}:${d_port}/${d_proto}}"
6 local dest_display="$resolved"
7 if [[ "$show_ports" == "true" && "$resolved" != "${d_ip}:"* && "$resolved" != "${d_ip} "* ]]; then
8 # Append dim raw IP:port — use printf to expand ANSI
9 dest_display=$(printf "%s \033[2m(%s:%s)\033[0m" "$resolved" "$d_ip" "$d_port")
10 fi
11 # If resolved AND --ports: append dim "(ip:port)"
12 if [[ "$show_ports" == "true" && "${_DEST_RESOLVE_CACHE[$spec]}" != "${d_ip}:"* ]]; then
13 dest_display+=" \033[2m(${d_ip}:${d_port})\033[0m"
14 fi
15 ui::activity::accept_dest_row \
16 "$dest_display" "$d_bytes_orig" "$d_bytes_reply" \
17 "$d_count" "$drops_col" "$w_count"
18 done
19 }
20
21 declare -gA _DEST_RESOLVE_CACHE=()
22 local -a _dest_specs=()
23root@wireguard:/etc/wireguard/wgctl#
24