head 1.2; access; symbols; locks; strict; comment @# @; 1.2 date 2007.06.25.18.20.02; author rse; state Exp; branches; next 1.1; commitid xMJ3DoJUrAvz4kns; 1.1 date 2007.06.25.17.10.28; author rse; state Exp; branches; next ; commitid MyBquEVTnUEHGjns; desc @@ 1.2 log @improve installation @ text @#!/bin/sh ## ## joomla-setup.sh -- Joomla! RDBMS Setup Utility ## # database configuration db_name="joomla" db_user="joomla" db_pass="joomla" # determine RDBMS-specific details db_suser=`grep "^user" @@l_prefix@@/etc/mysql/my.pwd |\ sed -e 's;^user[^=]*= *;;' -e 's; *$;;'` db_spass=`grep "^password" @@l_prefix@@/etc/mysql/my.pwd |\ sed -e 's;^password[^=]*= *;;' -e 's; *$;;'` # dispatch operation cmd="${1:-"install"}" case "$cmd" in install ) # create the database @@l_prefix@@/bin/mysqladmin --user="$db_suser" --password="$db_spass" create "$db_name" ( echo "GRANT ALL PRIVILEGES ON $db_name.* TO $db_user@@localhost IDENTIFIED BY '$db_pass';" echo "FLUSH PRIVILEGES;" ) | @@l_prefix@@/bin/mysql --user="$db_suser" --password="$db_spass" mysql # activate installer rm -f @@l_prefix@@/lib/joomla/runtime/configuration.php rm -rf @@l_prefix@@/lib/joomla/runtime/installation >/dev/null 2>&1 || true cp -rp @@l_prefix@@/lib/joomla/installation @@l_prefix@@/lib/joomla/runtime/ ;; cleanup ) # deactivate installer rm -rf @@l_prefix@@/lib/joomla/runtime/installation >/dev/null 2>&1 || true ;; uninstall ) # remove the database ( echo "DROP DATABASE $db_name;" ) | @@l_prefix@@/bin/mysql --user="$db_suser" --password="$db_spass" mysql # remove the generated configuration rm -f @@l_prefix@@/lib/joomla/runtime/configuration.php ;; esac @ 1.1 log @first cut for a Joomla! package @ text @d29 2 a30 2 rm -f @@l_prefix@@/lib/joomla/runtime/installation >/dev/null 2>&1 || true ln -s ../installation @@l_prefix@@/lib/joomla/runtime/installation @