Created
March 14, 2016 10:34
-
-
Save Wol/7cb1a8f758894da9e32e to your computer and use it in GitHub Desktop.
Bash script to check the status of Drupal pages for transition to Drupal 8
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
#!/bin/bash | |
echo "Checking modules" | |
cat modulelist.txt | while read m | |
do | |
echo -ne "${m}\t" | |
FILENAME="/tmp/drupaltmp_${m}" | |
if [ ! -f $FILENAME ] | |
then | |
wget -q -O- https://www.drupal.org/project/${m} > $FILENAME | |
fi | |
if [ -s $FILENAME ] | |
then | |
if grep -q "Page not found" $FILENAME | |
then | |
echo "Page Not Found" | |
elif grep -q "has not been ported to Drupal 8" $FILENAME | |
then | |
echo "Not Ported" | |
elif grep -q "has been included with Drupal 8 core" $FILENAME | |
then | |
echo "Core" | |
elif grep -q "has been renamed or deprecated by another module in Drupal 8" $FILENAME | |
then | |
echo "Renamed or deprecated by another module" | |
elif grep -q "is currently blocked from being ported to Drupal 8" $FILENAME | |
then | |
echo "Blocked" | |
elif grep -q "currently being ported to Drupal 8" $FILENAME | |
then | |
echo "In progress" | |
elif grep -q "has a pre-release version for Drupal 8" $FILENAME | |
then | |
echo "Prerelease version" | |
elif grep -q "8\.x-0\..-alpha" $FILENAME | |
then | |
echo "8.x-0 alpha version available" | |
rm $FILENAME | |
elif grep -q "8\.x-1\..-alpha" $FILENAME | |
then | |
echo "8.x-1 alpha version available" | |
rm $FILENAME | |
elif grep -q "8\.x-1\.." $FILENAME | |
then | |
echo "8.x-1 version available" | |
rm $FILENAME | |
elif grep -q "8\.x-2\.." $FILENAME | |
then | |
echo "8.x-2 version available" | |
rm $FILENAME | |
elif grep -q "Drupal 8" $FILENAME | |
then | |
echo "UNKNOWN" | |
rm $FILENAME | |
else | |
echo "No Mention of Drupal 8" | |
fi | |
else | |
echo "Page Not Found" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment