Last active
September 5, 2019 19:17
-
-
Save marduc812/42dc5a11f5d1042a728680410eaa6fb7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Path for the Forward DNS records zip | |
source="/root/Downloads/2019-01-25-1548374703-fdns_any.json.gz" | |
# Input with dot in front | |
in=.$1 | |
#Check if JQ is installed | |
if hash jq 2>/dev/null; then | |
# Execute slightly modified command, without the if statement. The previous IF statement was breaking the syntax because of multiple backslashes. | |
zcat $source | grep -F $in\" | jq -crM '.name' | grep $in | sort | uniq | tee -a $1.list | |
else | |
echo "jq parser was not found on your system." | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment