Commit 7a9389b4 authored by Vitaly Lipatov's avatar Vitaly Lipatov

add eterban cli for gateway target

parent 2a29c32d
#!/bin/sh
setname="eterban_1"
command="$1"
[ -n "$command" ] && shift
if [ "$command" = "count" ] ; then
echo "Count of banned:"
ipset list $setname | wc -l
exit
fi
if [ "$command" = "list" ] ; then
ipset list $setname
exit
fi
if [ "$command" = "unban" ] ; then
/usr/share/eterban/unban.py $1
exit
fi
if [ "$command" = "search" ] ; then
mask="$(echo "$1" | sed -e 's|\.|\\.|g')"
ipset list $setname | grep --color "$mask"
exit
fi
cat <<EOF
Usage:
eterban [count|list|search <ip>]
count - print count of banned IPs
list - list all banned IPs
search <ip> - search for ip in the list of banned IPs
unban <ip> - unban IP
EOF
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment