Added check IP function with Abudeipdb

This commit is contained in:
Phil 2024-08-24 10:29:28 +01:00
parent 7f7627412d
commit aadd6b9705

View File

@ -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 <IP_ADDRESS>"
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"