Last active
October 4, 2023 19:15
-
-
Save TaylorJadin/c6570f4b9a62e64998eb9dcf5832bd06 to your computer and use it in GitHub Desktop.
isitwp?
This file contains hidden or 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 | |
# Colors | |
INVALID='\033[0;31m' | |
WP='\033[0;34m' | |
NOWP='\033[0;33m' | |
NC='\033[0m' | |
for URL in "$@" | |
do | |
valid=$(curl -s --head "$URL" | grep "200") | |
if [[ ! -z "$valid" ]]; then | |
wp=$(curl -s "$URL" | grep "wp-content") | |
if [[ -z "$wp" ]]; then | |
printf "${NOWP}${URL}${NC}: No mention of wp-content in the page source. Probably not WordPress.\n" | |
else | |
printf "${WP}${URL}${NC}: I'm seeing wp-content in the page source. It's probably WordPress!\n" | |
fi | |
else | |
printf "${INVALID}${URL}${NC}: Sorry pal. That URL doesn't seem to be valid. Check the URL and try again.\n" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment