Commit 5c0e77d6 authored by anarcat's avatar anarcat
Browse files

cleanup empty platforms on upgrade

parent cc598189
......@@ -53,6 +53,14 @@ case "$1" in
echo "upgrading the frontend from $drupal_root to $NEW_PLATFORM"
cd "$drupal_root"
su -s /bin/sh aegir -c "drush hostmaster-migrate $FLAGS '$site_uri' '$NEW_PLATFORM'"
cd $HOME
sites=`ls "$drupal_root/sites" | egrep -v '^all|default$'`
if [ -z "$sites" ]; then
echo "backing up old platform to $HOME/backups/$drupal_root.tgz"
tar -c -z -f "$HOME/backups/$drupal_root.tgz" "$drupal_root"
echo "removing old platform from $HOME/$drupal_root"
rm -rf "$HOME/$drupal_root"
db_get "aegir/site"
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment