Skip to content

Instantly share code, notes, and snippets.

@mdpuma
Created July 11, 2021 15:11
Show Gist options
  • Save mdpuma/9fd8a3a8af9ac3e4668b3ec846a354e1 to your computer and use it in GitHub Desktop.
Save mdpuma/9fd8a3a8af9ac3e4668b3ec846a354e1 to your computer and use it in GitHub Desktop.
voxility.sh
#!/bin/bash -e
action=$1
argument=$2
IPS="1.1.1.1/24 2.2.2.2/24"
case "$action" in
listips)
#for i in $IPS; do
# curl "http://ips.voxility.com/list_json.php?ip_src=$i"
#done
curl "http://ips.voxility.com/list_json.php"
;;
always-on)
[[ -z "$argument" ]] && echo "Usage: $0 always-on IP" && exit 1
curl "http://ips.voxility.com/ips.php?ip=$argument&mode=1&no_l7=1"
;;
sensor)
[[ -z "$argument" ]] && echo "Usage: $0 always-off IP" && exit 1
curl "http://ips.voxility.com/ips.php?ip=$argument&mode=2&no_l7=1"
;;
statusip)
[[ -z "$argument" ]] && echo "Usage: $0 statusip IP" && exit 1
curl "http://ips.voxility.com/list_json.php?ip_src=$argument"
;;
getlastattacks)
if [ -n "$argument" ]; then
curl "http://ips.voxility.com/get_attacks.php?ip_dst=$argument"
else
curl "http://ips.voxility.com/get_attacks.php"
fi
;;
*)
cat <<EOF
Usage: $0 command argument
$0 listips list status of our ip addresses
$0 getlastattacks attacks from last 2 days
$0 statusip IP show status of one ip address
$0 always-on IP enable alwayson protection
$0 sensor IP restore default sensor mode
EOF
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment