#!/bin/sh # Magento Commerce (1.6.0.0) Installer # Version 1 r6, 10-06-2011 # By JuanJose Galvez (DH Tech Support) # Based on Magento command line install isntructions # Abort on any errors set -e # DH Specific ENV variables export MAGE_PEAR_PHP_BIN=/usr/local/php5/bin/php export PATH=/usr/local/php5/bin:$PATH # User Variables DBHOST="" DBNAME="" DBUSER="" DBPASS="" DBPREFIX="" URL="" ADMINFIRST="" ADMINLAST="" ADMINEMAIL="" ADMINUSER="" ADMINPASS="" # Other Needed Variables For Install LICENSEAGREE="yes" LOCALE="en_US" TIMEZONE="America/Los_Angeles" CURRENCY="USD" REWRITES="yes" SECURE="no" SECUREURL="" SECUREADMIN="no" if test $# == 0 then echo "In order to install Magento all the following are required." echo " -h: MySQL Database Hostname" echo " -d: MySQL Database Name" echo " -u: MySQL Database User" echo " -p: MySQL Database Password" echo " -x: Database Prefix" echo " -a: Magento Shop Address (Example: http://shop.example.com/)" echo " -f: Magento Admin First Name" echo " -l: Magento Admin Last Name" echo " -e: Magento Admin Email Address" echo " -r: Magento Admin Login" echo " -s: Magento Admin Pass (Must have letters and numbers.)" exit 1 fi while getopts "h:d:u:p:x:a:f:l:e:r:s:" args do case "$args" in h) DBHOST=$OPTARG;; d) DBNAME=$OPTARG;; u) DBUSER=$OPTARG;; p) DBPASS=$OPTARG;; x) DBPREFIX=$OPTARG;; a) URL=$OPTARG;; f) ADMINFIRST=$OPTARG;; l) ADMINLAST=$OPTARG;; e) ADMINEMAIL=$OPTARG;; r) ADMINUSER=$OPTARG;; s) ADMINPASS=$OPTARG;; esac done if [ -f magento-1.6.0.0.tar.gz ] then tar -zxvf magento-1.6.0.0.tar.gz else echo "You must upload a copy of magento-1.6.0.0.tar.gz before attempting the install." exit 1 fi # Move the magento files to the current directory. mv magento/* magento/.htaccess . # Setup/Install Mage chmod 0744 ./mage ./mage mage-setup . #Remove pearlib cache rm -rf downloader/pearlib/cache/* downloader/pearlib/download/* /usr/local/php5/bin/php -f install.php -- \ --license_agreement_accepted "${LICENSEAGREE}" \ --locale "${LOCALE}" \ --timezone "${TIMEZONE}" \ --default_currency "${CURRENCY}" \ --db_host "${DBHOST}" \ --db_name "${DBNAME}" \ --db_user "${DBUSER}" \ --db_pass "${DBPASS}" \ --url "${URL}" \ --use_rewrites "${REWRITES}" \ --use_secure "${SECURE}" \ --secure_base_url "${SECUREURL}" \ --use_secure_admin "${SECUREADMIN}" \ --admin_firstname "${ADMINFIRST}" \ --admin_lastname "${ADMINLAST}" \ --admin_email "${ADMINEMAIL}" \ --admin_username "${ADMINUSER}" \ --admin_password "${ADMINPASS}"; # Clean up empty magento folder which is no longer needed rm -rf magento/