| 123456789101112131415161718192021222324252627282930313233343536 |
- #!/bin/sh
- ##
- ## drupal-setup
- ##
- # determine MySQL administrator username/password
- username=`grep "^user" @l_prefix@/etc/mysql/my.pwd |\
- sed -e 's;^user[^=]*= *;;' -e 's; *$;;'`
- password=`grep "^password" @l_prefix@/etc/mysql/my.pwd |\
- sed -e 's;^password[^=]*= *;;' -e 's; *$;;'`
- # create the MySQL database for Drupal
- @l_prefix@/bin/mysqladmin --user=$username --password=$password create drupal
- @l_prefix@/bin/mysql --user=$username --password=$password mysql <<EOF
- GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES \
- ON drupal.* \
- TO drupal@localhost IDENTIFIED BY 'drupal';
- FLUSH PRIVILEGES;
- EOF
- # configure settings.php accordingly
- @l_prefix@/lib/openpkg/shtool subst --quiet \
- -e 's|^\( *\$db_url\) *=.*$|\1 = "mysql://drupal:drupal@localhost/drupal";|' \
- @l_prefix@/share/drupal/sites/default/settings.php
- # check php script memory limit
- d=`sed <@l_prefix@/etc/apache/apache-php.ini -e 's/ *;.*$//' | awk -F= '/^memory_limit/ { print $2 }' | sed -e 's/M//'`
- [ $d -lt 16 ] && echo "please consider increasing memory_limit to 16M or more in @l_prefix@/etc/apache/apache-php.ini"
- # further instructions for the user
- d=`awk <@l_prefix@/etc/drupal/drupal-apache.conf '/^Listen/ { print $2 }'`
- echo "configure IP address in \"@l_prefix@/etc/drupal/drupal-apache.conf\""
- echo "run \"@l_prefix@/bin/openpkg rc drupal start\""
- echo "visit http://$d/install.php"
|