最后活跃于 1 month ago

nuno 修订了这个 Gist 1 month ago. 转到此修订

1 file changed, 20 insertions

gistfile1.txt(文件已创建)

@@ -0,0 +1,20 @@
1 + 156:function peers::is_blocked() {
2 + 158: block::is_blocked "$name"
3 + 250: local is_blocked
4 + 251: peers::is_blocked "$name" && is_blocked="true" || is_blocked="false"
5 + 252: if [[ "$is_blocked" == "true" ]]; then
6 + 325: local name="${1:-}" client_ip="${2:-}" was_blocked="${3:-false}"
7 + 333: if [[ -n "$client_ip" ]] && $was_blocked; then
8 + 348: local name="${1:-}" pubkey="${2:-}" is_blocked="${3:-false}"
9 + 352: data=$(peers::last_seen_data "$is_blocked" "$last_ts" "$handshake_ts")
10 + 365: local name="${1:-}" public_key="${2:-}" is_blocked="${3:-false}"
11 + 369: state=$(peers::connection_state "$is_blocked" "$is_restricted" \
12 + 376: if [[ "$is_blocked" == "true" ]]; then
13 + 377: color="\033[1;31m" # red — blocked
14 + 392:function peers::format_status_verbose() {
15 + 393: local name="${1:-}" public_key="${2:-}" is_blocked="${3:-false}"
16 + 398: state=$(peers::connection_state "$is_blocked" "$is_restricted" \
17 + 403: if [[ "$is_blocked" == "true" ]]; then
18 + 405: suffix=" (blocked)"
19 + 430: local is_blocked="${1:-false}" is_restricted="${2:-false}"
20 + 438: if [[ "$is_blocked" == "true" ]]; then
上一页 下一页