Skip to content

Instantly share code, notes, and snippets.

@TaylorJadin
Last active October 4, 2023 19:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TaylorJadin/c6570f4b9a62e64998eb9dcf5832bd06 to your computer and use it in GitHub Desktop.
Save TaylorJadin/c6570f4b9a62e64998eb9dcf5832bd06 to your computer and use it in GitHub Desktop.
isitwp?
#!/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