diff --git a/.aliases b/.aliases index a9e877d..2940f22 100644 --- a/.aliases +++ b/.aliases @@ -450,6 +450,31 @@ echo "| 0 | 16777216| 255.0.0.0 | 11111111 | 8 | echo "--------------------------------------------------------------------------" } +## Check AbuseIPdb +abuseip_check() { +ip="$1" + +abuseipdb_api_key="$HOME/.api/.abuseipdb_api_key" + + if [ ! -f "$abuseipdb_api_key" ]; then + echo "API key file not found at $abuseipdb_api_key" + return 1 + fi + + api_key=$(cat "$abuseipdb_api_key") + + if [ -z "$ip" ]; then + echo "Usage: abuseip_check " + return 1 + fi + + curl --silent -G https://api.abuseipdb.com/api/v2/check \ + --data-urlencode "ipAddress=$ip" \ + -d maxAgeInDays=90 \ + -d verbose \ + -H "Key: $api_key" \ + -H "Accept: application/json" | jq +} alias temp="vcgencmd measure_temp" ## Display all commands in this Alias file alias my-alias="cat ~/.aliases | grep -oP 'alias\s\K[^=]+' | sort -n"