-
-
Save hampusn/dc3efb4736d07bdc58ffbccd122de7f3 to your computer and use it in GitHub Desktop.
Bash-script to get the current SiteVision version for a URL
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 | |
#################################################### | |
# Script to get the SiteVision version of a URL. | |
# This depends on the linked assets having the | |
# version number in their URLs. | |
#################################################### | |
if [ -z "$1" ]; then | |
echo "Missing argument (URL)" | |
exit 1 | |
fi | |
URL=$1 | |
RESULT=$(curl -m 10 --retry 3 -L --max-redirs 3 -s $URL | sed -nE 's/.*\/sitevision\/([0-9\.\-]+)\/.*/\1/p' | sed 1q) | |
if [ -n "$RESULT" ]; then | |
echo "SiteVision $RESULT" | |
else | |
echo "Not running SiteVision" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment