diff options
| author | 2015-07-24 09:00:14 +0000 | |
|---|---|---|
| committer | 2015-07-24 09:00:14 +0000 | |
| commit | 556a8ecc39c311504de273b00deb28222e0890f3 (patch) | |
| tree | 0bc47c1d6f4de2342094a84f86e7aba0207c5177 /bash/.bashrc | |
| parent | 5c726723647d228b9ac94405b87035aaff88bf3e (diff) | |
| download | dotfiles-556a8ecc39c311504de273b00deb28222e0890f3.tar.gz dotfiles-556a8ecc39c311504de273b00deb28222e0890f3.tar.bz2 dotfiles-556a8ecc39c311504de273b00deb28222e0890f3.zip | |
Added ban counter to showbanned
Diffstat (limited to 'bash/.bashrc')
| -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 |
