joomla/joomla-setup.sh

Tue, 28 Aug 2012 18:36:35 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 28 Aug 2012 18:36:35 +0200
changeset 579
6b18bb69901e
permissions
-rw-r--r--

Correct the paths of patched scripts, refine password generation,
mitigate fdatasync(2) detection problems, correct dependencies, remove
outdated autoconf components, correct conf file paths and attributes,
complete and correct log file rotation handing, and note warnings
useful for diagnosing builds.

michael@535 1 #!/bin/sh
michael@535 2 ##
michael@535 3 ## joomla-setup.sh -- Joomla! RDBMS Setup Utility
michael@535 4 ##
michael@535 5
michael@535 6 # database configuration
michael@535 7 db_name="joomla"
michael@535 8 db_user="joomla"
michael@535 9 db_pass="joomla"
michael@535 10
michael@535 11 # determine RDBMS-specific details
michael@535 12 db_suser=`grep "^user" @l_prefix@/etc/mysql/my.pwd |\
michael@535 13 sed -e 's;^user[^=]*= *;;' -e 's; *$;;'`
michael@535 14 db_spass=`grep "^password" @l_prefix@/etc/mysql/my.pwd |\
michael@535 15 sed -e 's;^password[^=]*= *;;' -e 's; *$;;'`
michael@535 16
michael@535 17 # dispatch operation
michael@535 18 cmd="${1:-"install"}"
michael@535 19 case "$cmd" in
michael@535 20 install )
michael@535 21 # create the database
michael@535 22 @l_prefix@/bin/mysqladmin --user="$db_suser" --password="$db_spass" create "$db_name"
michael@535 23 ( echo "GRANT ALL PRIVILEGES ON $db_name.* TO $db_user@localhost IDENTIFIED BY '$db_pass';"
michael@535 24 echo "FLUSH PRIVILEGES;"
michael@535 25 ) | @l_prefix@/bin/mysql --user="$db_suser" --password="$db_spass" mysql
michael@535 26
michael@535 27 # activate installer
michael@535 28 rm -f @l_prefix@/lib/joomla/runtime/configuration.php
michael@535 29 rm -rf @l_prefix@/lib/joomla/runtime/installation >/dev/null 2>&1 || true
michael@535 30 cp -rp @l_prefix@/lib/joomla/installation @l_prefix@/lib/joomla/runtime/
michael@535 31 ;;
michael@535 32 cleanup )
michael@535 33 # deactivate installer
michael@535 34 rm -rf @l_prefix@/lib/joomla/runtime/installation >/dev/null 2>&1 || true
michael@535 35 ;;
michael@535 36 uninstall )
michael@535 37 # remove the database
michael@535 38 ( echo "DROP DATABASE $db_name;"
michael@535 39 ) | @l_prefix@/bin/mysql --user="$db_suser" --password="$db_spass" mysql
michael@535 40
michael@535 41 # remove the generated configuration
michael@535 42 rm -f @l_prefix@/lib/joomla/runtime/configuration.php
michael@535 43 ;;
michael@535 44 esac
michael@535 45

mercurial