Created
March 28, 2022 19:49
-
-
Save dustinbutterworth/235c1a71705934969ce758357b3823bb to your computer and use it in GitHub Desktop.
Query Cloudflare Subcategory IDs to see what an ID number correlates to
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
#!/usr/bin/env bash | |
# Provide the Subcategory ID number you want to check as an argument to the script. | |
# It will show you detailsa bout that Subcategory ID pulled from cloudflare docs github page. | |
# Trying to pull dierctly from the developer documentation pages, curl is blocked. This bypasses that. | |
category_number=$1 | |
url="https://raw.githubusercontent.com/cloudflare/cloudflare-docs/production/content/cloudflare-one/policies/filtering/dns-policies-builder/dns-categories.md" | |
echo "| Category ID | Category Name | Subcategory ID | Subcategory Name |" | |
curl -s "$url" | sed -n -e '/DNS Category and Subcategory IDs/,$p' | grep '^|' | awk -F '|' '$4 ~ "'${category_number}'" {print $0}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment