14 lines
407 B
Bash
Executable File
14 lines
407 B
Bash
Executable File
#!/bin/bash
|
|
|
|
#var=`/usr/bin/fail2ban-client status sshd |grep "Total banned"|awk -F":" '{print $2}'`
|
|
|
|
# remove leading whitespace characters
|
|
#banned="${var#"${var%%[![:space:]]*}"}"
|
|
|
|
banned=`/usr/sbin/iptables -L -n --line|/bin/grep REJECT|wc -l`
|
|
json="http://localhost:81/json.htm?type=command¶m=udevice&idx=700&svalue=$banned"
|
|
echo $json
|
|
|
|
curl -s -i -H "Accept: application/json" $json
|
|
echo $banned;
|