joomla/joomla-setup.sh

Thu, 04 Oct 2012 20:30:05 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 04 Oct 2012 20:30:05 +0200
changeset 715
c10fb90893b9
permissions
-rw-r--r--

Correct out of date build configuration, porting to Solaris 11 network
link infrastructure and new libpcap logic. This additionally allows for
device drivers in subdirectories of /dev. Correct packaged nmap
personalities and signatures to work out of the box. Finally, hack
arpd logic to properly close sockets and quit on TERM by repeating
signaling in the run command script. Sadly, all this fails to correct
the run time behaviour of honeyd which fails to bind to the IP layer.

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

mercurial