From 69bbbebce848d0e07c73ffbbd64d10b3e569251a Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Wed, 8 Feb 2017 19:23:39 -0200 Subject: Removes install action --- files/drupal | 111 +---------------------------------------------------------- 1 file changed, 1 insertion(+), 110 deletions(-) (limited to 'files/drupal') diff --git a/files/drupal b/files/drupal index 9783e23..b22e893 100755 --- a/files/drupal +++ b/files/drupal @@ -264,115 +264,9 @@ function drupal_make { fi } -# Install a new instance -function drupal_install { - if [ -z "$2" ]; then - echo "Usage: `basename $0` install [aliases]" - exit 1 - fi - - # Required arguments - series="$1" - site="$2" - shift 2 - - # Site aliases - aliases="$*" - - # Other parameters - domain="`facter domain`" - - if [ "$series" != "6" ]; then - # Installation parameters - drupal_user_input name "$site" "Site name" - drupal_user_input site_email "$site@$domain" "Site email" - drupal_user_input profile "standard" "Installation profile" - drupal_user_input locale "pt-br" "Installation language" - drupal_user_input admin "$site" "Admin user" - drupal_user_input admin_email "$admin@$domain" "Admin email" - fi - - if [ -e "$BASE/drupal-$series/sites/$site" ]; then - echo "Drupal $site already installed at $BASE/drupal-$series" - echo "Installation will be overwritten" - else - # Check installation - if [ ! -e "$BASE/drupal-$series" ]; then - echo "Please download your drupal $series farm first" - exit 1 - fi - - echo "Creating $SITES/$site/drupal/ structure..." - mkdir -p $SITES/$site/drupal/{files,themes,modules,libraries} - - echo "Copying default configuration file..." - cp $BASE/drupal-$series/sites/default/default.settings.php $SITES/$site/drupal/settings.php - chmod 640 $SITES/$site/drupal/settings.php - - ( - echo "Creating symlinks..." - cd $BASE/drupal-$series/sites - ln -s $SITES/$site/drupal $site - ln -s $SITES/$site/drupal $site.$domain - - for alias in $aliases; do - ln -s $SITES/$site/drupal $alias - done - ) - - # Aditional parameters - drupal_user_input dbname "$site" "Database name" - drupal_user_input dbuser "$site" "Database user" - drupal_user_input dbpasswd "$site" "Database passwd" - echo "" - - echo "Configuring settings.php" - if [ "$series" == "7" ]; then - cat >> $SITES/$site/drupal/settings.php <<-EOF -\$databases['default']['default'] = array( -'driver' => 'mysql', -'database' => '$dbname', -'username' => '$dbuser', -'password' => '$dbpasswd', -'host' => 'localhost', -'prefix' => '', -); -EOF - elif [ "$series" == "6" ]; then - cat >> $SITES/$site/drupal/settings.php <<-EOF -\$db_url = 'mysql://$dbuser:$dbpasswd@localhost/$dbname'; -EOF - fi - fi - - if [ "$series" != "6" ]; then - ( - echo "Installing drupal $series for $site using $profile profile..." - cd $BASE/drupal-$series/ - drush site-install $profile --site-name="$name" --site-mail="$site_email" --locale=$locale \ - --uri="$site" --sites-subdir="$site" --account-name="$admin" --account-mail="$admin_email" - ) - fi - - # Fix permissions - if grep -qe "^$site:" /etc/passwd; then - chown drupal.$site $SITES/$site/drupal/settings.php - chown $site.$site $SITES/$site/drupal/{files,themes,modules,libraries} - else - chown drupal.www-data $SITES/$site/drupal/settings.php - chown www-data.www-data $SITES/$site/drupal/{files,themes,modules,libraries} - fi - - if [ "$series" == "6" ]; then - echo "Now please access http://$site.$domain/install.php to continue with the installation." - else - echo "Done. Please check your installation." - fi -} - # Main procedure if [ -z "$1" ]; then - echo "Usage: `basename $0` [arguments]" + echo "Usage: `basename $0` [arguments]" exit 1 elif [ "$1" == "cron" ]; then drupal_iterate cron @@ -403,9 +297,6 @@ elif [ "$1" == "run" ]; then elif [ "$1" == "make" ]; then shift drupal_make $* -elif [ "$1" == "install" ]; then - shift - drupal_install $* else echo "No action $1" exit 1 -- cgit v1.2.3