diff options
Diffstat (limited to 'share/hydractl/backup-restore-site')
-rwxr-xr-x | share/hydractl/backup-restore-site | 21 |
1 files changed, 18 insertions, 3 deletions
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 |