Created
January 31, 2016 01:49
-
-
Save hirowatari/9b7d0f5a5e8456fdbf6c to your computer and use it in GitHub Desktop.
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/bash | |
random_string() { | |
< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c${1:-32}; echo; | |
} | |
: ${TABLE_PREFIX=wp_} | |
cat > /var/www/html/wp-config.php <<EOF | |
<?php | |
define('DB_NAME', '$MYSQL_ENV_MYSQL_DATABASE'); | |
define('DB_USER', '$MYSQL_ENV_MYSQL_USER'); | |
define('DB_PASSWORD', '$MYSQL_ENV_MYSQL_PASSWORD'); | |
define('DB_HOST', 'mysql'); | |
define('DB_CHARSET', 'utf8'); | |
define('DB_COLLATE', ''); | |
define('AUTH_KEY', '$(random_string)'); | |
define('SECURE_AUTH_KEY', '$(random_string)'); | |
define('LOGGED_IN_KEY', '$(random_string)'); | |
define('NONCE_KEY', '$(random_string)'); | |
define('AUTH_SALT', '$(random_string)'); | |
define('SECURE_AUTH_SALT', '$(random_string)'); | |
define('LOGGED_IN_SALT', '$(random_string)'); | |
define('NONCE_SALT', '$(random_string)'); | |
\$table_prefix = '$TABLE_PREFIX'; | |
define('WP_DEBUG', false); | |
if ( !defined('ABSPATH') ) | |
define('ABSPATH', dirname(__FILE__) . '/'); | |
require_once(ABSPATH . 'wp-settings.php'); | |
EOF | |
exec "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment