Last active
August 29, 2015 14:01
-
-
Save homaily/4119584c85e33ae95a7a to your computer and use it in GitHub Desktop.
This file contains 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/bash | |
DIR=`pwd` | |
DB_HOSTNAME_DEFAULT=localhost | |
DB_USERNAME_DEFAULT=root | |
read -p "Enter HTTP_SERVER: " HTTP_SERVER | |
read -p "Enter DB_HOSTNAME ($DB_HOSTNAME_DEFAULT): " DB_HOSTNAME | |
read -p "Enter DB_USERNAME ($DB_USERNAME_DEFAULT): " DB_USERNAME | |
read -p "Enter DB_PASSWORD: " DB_PASSWORD | |
read -p "Enter DB_DATABASE: " DB_DATABASE | |
read -p "Enter DB_PREFIX: " DB_PREFIX | |
DB_HOSTNAME=${DB_HOSTNAME:-$DB_HOSTNAME_DEFAULT} | |
DB_USERNAME=${DB_USERNAME:-$DB_USERNAME_DEFAULT} | |
touch $DIR/config.php | |
touch $DIR/admin/config.php | |
cat > $DIR/config.php <<EOF | |
<?php | |
// HTTP | |
define('HTTP_SERVER', '$HTTP_SERVER/'); | |
// HTTPS | |
define('HTTPS_SERVER', '$HTTP_SERVER/'); | |
// DIR | |
define('DIR_APPLICATION', '$DIR/catalog/'); | |
define('DIR_SYSTEM', '$DIR/system/'); | |
define('DIR_DATABASE', '$DIR/system/database/'); | |
define('DIR_LANGUAGE', '$DIR/catalog/language/'); | |
define('DIR_TEMPLATE', '$DIR/catalog/view/theme/'); | |
define('DIR_CONFIG', '$DIR/system/config/'); | |
define('DIR_IMAGE', '$DIR/image/'); | |
define('DIR_CACHE', '$DIR/system/cache/'); | |
define('DIR_DOWNLOAD', '$DIR/download/'); | |
define('DIR_LOGS', '$DIR/system/logs/'); | |
// DB | |
define('DB_DRIVER', 'mysql'); | |
define('DB_HOSTNAME', '$DB_HOSTNAME'); | |
define('DB_USERNAME', '$DB_USERNAME'); | |
define('DB_PASSWORD', '$DB_PASSWORD'); | |
define('DB_DATABASE', '$DB_DATABASE'); | |
define('DB_PREFIX', '$DB_PREFIX'); | |
?> | |
EOF | |
cat > $DIR/admin/config.php <<EOF | |
<?php | |
// HTTP | |
define('HTTP_SERVER', '$HTTP_SERVER/admin/'); | |
define('HTTP_CATALOG', '$HTTP_SERVER/'); | |
// HTTPS | |
define('HTTPS_SERVER', '$HTTP_SERVER/admin/'); | |
define('HTTPS_CATALOG', '$HTTP_SERVER/'); | |
// DIR | |
define('DIR_APPLICATION', '$DIR/admin/'); | |
define('DIR_SYSTEM', '$DIR/system/'); | |
define('DIR_DATABASE', '$DIR/system/database/'); | |
define('DIR_LANGUAGE', '$DIR/admin/language/'); | |
define('DIR_TEMPLATE', '$DIR/admin/view/template/'); | |
define('DIR_CONFIG', '$DIR/system/config/'); | |
define('DIR_IMAGE', '$DIR/image/'); | |
define('DIR_CACHE', '$DIR/system/cache/'); | |
define('DIR_DOWNLOAD', '$DIR/download/'); | |
define('DIR_LOGS', '$DIR/system/logs/'); | |
define('DIR_CATALOG', '$DIR/catalog/'); | |
// DB | |
define('DB_DRIVER', 'mysql'); | |
define('DB_HOSTNAME', '$DB_HOSTNAME'); | |
define('DB_USERNAME', '$DB_USERNAME'); | |
define('DB_PASSWORD', '$DB_PASSWORD'); | |
define('DB_DATABASE', '$DB_DATABASE'); | |
define('DB_PREFIX', '$DB_PREFIX'); | |
?> | |
EOF | |
mkdir -p $DIR/{download,system/logs,system/cache,image/cache,image/cache/data,image/data} | |
chmod 777 $DIR/download | |
chmod 777 $DIR/system/logs | |
chmod 777 $DIR/system/cache | |
chmod 777 $DIR/image/cache | |
chmod 777 $DIR/image/cache/data | |
chmod 777 $DIR/image/data | |
echo "Done, Bye :)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment