Last active
January 1, 2016 06:09
-
-
Save matthewhaworth/bfc300ecb5a75618d0d5 to your computer and use it in GitHub Desktop.
Magento Install Script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| MAGENTO_VERSION=1.7.0.2 | |
| MAGENTO_VERSION_RAW=$(echo $MAGENTO_VERSION | tr -d '.') | |
| mkdir SUBDIRECTORY | |
| cd SUBDIRECTORY | |
| wget http://www.magentocommerce.com/downloads/assets/$MAGENTO_VERSION/magento-$MAGENTO_VERSION.tar.gz | |
| tar -zxvf magento-$MAGENTO_VERSION.tar.gz | |
| if [ "$MAGENTO_VERSION_RAW" -lt 1610 ] | |
| then | |
| wget http://www.magentocommerce.com/downloads/assets/1.2.0/magento-sample-data-1.2.0.tar.gz | |
| tar -zxvf magento-sample-data-1.2.0.tar.gz | |
| mv magento-sample-data-1.2.0/media/* magento/media/ | |
| mv magento-sample-data-1.2.0/magento-sample-data-1.2.0.sql magento/data.sql | |
| else | |
| wget http://www.magentocommerce.com/downloads/assets/1.6.1.0/magento-sample-data-1.6.1.0.tar.gz | |
| tar -zxvf magento-sample-data-1.6.1.0.tar.gz | |
| mv magento-sample-data-1.6.1.0/media/* magento/media/ | |
| mv magento-sample-data-1.6.1.0/magento_sample_data_for_1.6.1.0.sql magento/data.sql | |
| fi | |
| mv magento/* magento/.htaccess . | |
| chmod -R o+w media | |
| mysql -h DBHOST -u DBUSER -pDBPASS DBNAME < data.sql | |
| # .. download and install | |
| touch var/.htaccess | mkdir app/etc | |
| chmod o+w var var/.htaccess app/etc | |
| rm -rf downloader/pearlib/cache/* downloader/pearlib/download/* | |
| rm -rf magento/ magento-sample-data-1.6.1.0/ | |
| rm -rf magento-downloader-1.7.0.0.tar.gz magento-sample-data-1.6.1.0.tar.gz data.sql |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment