Created
March 14, 2016 11:20
-
-
Save Wol/caac909f29f4162627d1 to your computer and use it in GitHub Desktop.
Drupal release check script
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 | |
echo "Checking modules" | |
cat modulelist.txt | while read m | |
do | |
# echo -ne "${m}\t" | |
FILENAME="/tmp/drupaltmp_${m}.xml" | |
if [ -f $FILENAME ] | |
then | |
if [ ! -s $FILENAME ] | |
then | |
rm $FILENAME | |
fi | |
fi | |
if [ ! -f $FILENAME ] | |
then | |
wget -q -O- https://updates.drupal.org/release-history/${m}/8.x > $FILENAME | |
fi | |
RELCOUNT=`xmllint --xpath "count(/project/releases/release)" $FILENAME` | |
ERRCOUNT=`xmllint --xpath "count(/error)" $FILENAME` | |
if [ $ERRCOUNT -gt 0 ]; then | |
# If error text needs to be used, uncomment the following line: | |
# ERRORTEXT=`xmllint --xpath "/error/text()" $FILENAME` | |
echo "-" | |
elif [ $RELCOUNT -eq 0 ]; then | |
echo "No releases available" | |
else | |
RELEASENAME=`xmllint --xpath "/project/releases/release[1]/version/text()" $FILENAME` | |
echo "$RELEASENAME" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment