Last active
August 29, 2015 14:24
-
-
Save alberto56/e90e8a30dc73c4df8395 to your computer and use it in GitHub Desktop.
Use existing Drupal database
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ "$#" -ne "3" ] | |
then | |
echo "Please supply exactly three arguments:" | |
echo "" | |
echo " (1) the database username" | |
echo " (2) the database password, or NOPWD if none" | |
echo " (3) the database name" | |
else | |
if [ "$2" == "NOPWD" ]; then | |
PASS="" | |
else | |
PASS="$2" | |
fi | |
echo '$'"databases = array ( 'default' => array ( 'default' => array ( 'database' => '$3', 'username' => '$1', 'password' => '$PASS', 'host' => 'localhost', 'port' => '', 'driver' => 'mysql', 'prefix' => '')),);" >> sites/default/settings.php | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment