diff options
| -rw-r--r-- | bash/.bashrc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/bash/.bashrc b/bash/.bashrc index 5e0625b..66a722c 100644 --- a/bash/.bashrc +++ b/bash/.bashrc | |||
| @@ -86,7 +86,14 @@ if exists pfctl && exists sudo; then | |||
| 86 | { | 86 | { |
| 87 | for table in "fail2ban" "permaban"; do | 87 | for table in "fail2ban" "permaban"; do |
| 88 | banned=$(sudo pfctl -t $table -T show 2> /dev/null) | 88 | banned=$(sudo pfctl -t $table -T show 2> /dev/null) |
| 89 | echo -e "$table\n$banned" | 89 | |
| 90 | if [ -z "$banned" ]; then | ||
| 91 | nrBanned="0" | ||
| 92 | else | ||
| 93 | nrBanned=$(echo "$banned" | wc -l | awk '{ print $1 }') | ||
| 94 | fi | ||
| 95 | |||
| 96 | echo -e "$table ($nrBanned)\n$banned" | ||
| 90 | done | 97 | done |
| 91 | } | 98 | } |
| 92 | fi | 99 | fi |
