From fe6c78345f01f26d169f66373d43f5fcc860c4df Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Tue, 27 Sep 2011 19:09:39 -0300 Subject: Handling drupal symlinks --- share/hydractl/backup-restore-site | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'share/hydractl') diff --git a/share/hydractl/backup-restore-site b/share/hydractl/backup-restore-site index ddb09ee..a5863b4 100755 --- a/share/hydractl/backup-restore-site +++ b/share/hydractl/backup-restore-site @@ -11,6 +11,7 @@ hydra_config_load SITE="$2" SITES="/var/sites" FOLDER="$SITES/$SITE" +WWW="/var/www/data" if [ -z "$SITE" ]; then hydra_action_usage @@ -64,11 +65,25 @@ fi # Drupal if [ -e "$FOLDER/drupal" ]; then - # TODO: how to check drupal series? - # TODO: check symlinks - # TODO: database import + SERIES="$3" + chown root.$SITE $FOLDER/drupal/settings.php chmod 640 $FOLDER/drupal/settings.php + + if [ ! -z "$SERIES" ]; then + if [ ! -e "$WWW/drupal-$SERIES" ]; then + echo "Creating basic drupal symlinks..." + ( + cd $WWW/drupal-$SERIES/sites + ln -sf $FOLDER/drupal $SITE + ln -sf $FOLDER/drupal $SITE.`facter domain` + ) + else + echo "No drupal $SERIES found in the system, so no symlink handling" + fi + else + echo "No drupal series argument provided, so no symlink handling" + fi fi # Restore database -- cgit v1.2.3