joomla/joomla-setup.sh

Mon, 17 Sep 2012 19:10:10 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Mon, 17 Sep 2012 19:10:10 +0200
changeset 689
9fe04d4d4e5a
permissions
-rw-r--r--

Update to new version of vendor software although Oracle fails to deliver.
More specifically, newer db(3) patch revisions exist but Oracle has
removed them from the canonical download server URI for Berkely DB.

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