Son aktivite 1 month ago

Revizyon 7c8e3bafe161b9c14e592efa63e603236558db23

gistfile1.txt Ham
1function fw::restore_block_rules() {
2 while IFS= read -r peer_name; do
3 local block_file
4 block_file="$(ctx::block::path "${peer_name}.block")"
5 [[ ! -f "$block_file" ]] && continue
6
7 local client_ip
8 client_ip=$(peers::get_ip "$peer_name")
9 [[ -z "$client_ip" ]] && continue
10
11 while IFS="|" read -r bname btype target port proto; do
12 [[ -z "$btype" ]] && continue
13 case "$btype" in
14 full) fw::block_all "$client_ip" "$peer_name" ;;
15 ip) fw::block_ip "$client_ip" "$target" ;;
16 port) fw::block_port "$client_ip" "$target" "$port" "${proto:-tcp}" ;;
17 subnet) fw::block_subnet "$client_ip" "$target" ;;
18 esac
19 done < <(json::block_get_rules "$block_file")
20 done < <(peers::all)
21}