diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2011-09-27 19:09:39 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2011-09-27 19:09:39 -0300 |
commit | fe6c78345f01f26d169f66373d43f5fcc860c4df (patch) | |
tree | 6a81e1540b29b37f068961ec6272937efb6d877c /share/hydractl/backup-restore-site | |
parent | ef1d22f0fddeac9be4846e20e218bcf08312e9e2 (diff) | |
download | hydra-fe6c78345f01f26d169f66373d43f5fcc860c4df.tar.gz hydra-fe6c78345f01f26d169f66373d43f5fcc860c4df.tar.bz2 |
Handling drupal symlinks
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 |