Created
March 18, 2010 16:03
-
-
Save ngmaloney/336504 to your computer and use it in GitHub Desktop.
Drupal Drush Update Script
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 | |
DRUSH="$(which drush)" | |
BASEDIR="/var/www/vhosts/mysite.com/httpdocs" | |
cd $BASEDIR | |
#Iterate through sites and put in offline mode | |
ls $BASEDIR/sites |while read line | |
do | |
if [[ "$line" != "all" && "$line" != "default" && "$line" != "CVS" ]] | |
then | |
#Put Site Offline | |
offline_cmd="$DRUSH --uri=$line vset site_offline 1 -y" | |
$offline_cmd | |
fi | |
done | |
#Iterate through sites update | |
ls $BASEDIR/sites |while read line | |
do | |
if [[ "$line" != "all" && "$line" != "default" && "$line" != "CVS" ]] | |
then | |
#Update Site | |
update_cmd="$DRUSH --uri=$line up -y" | |
$update_cmd | |
#UpdateDB | |
updatedb_cmd="$DRUSH --uri=$line updatedb -y" | |
$updatedb_cmd | |
fi | |
done | |
#Iterate through sites and put back online | |
ls $BASEDIR/sites |while read line | |
do | |
if [[ "$line" != "all" && "$line" != "default" && "$line" != "CVS" ]] | |
then | |
#Put Site Back Online | |
online_cmd="$DRUSH --uri=$line vset site_offline 0 -y" | |
$online_cmd | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment