You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
764 B

1 year ago
  1. #!/bin/bash
  2. SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
  3. . "${SCRIPT_DIR}/settings.sh" || {
  4. echo "no settings" && exit 1
  5. }
  6. wp core config --dbname=$PROJECT_NAME --dbuser=$PROJECT_NAME --dbpass=$PROJECT_NAME --dbhost=db --dbprefix=$TABLE_PREFIX
  7. sed -i 's/<?php//' "${PROJECT_WEB_ROOT}/wp-config.php"
  8. cat << \EOF | cat - "${PROJECT_WEB_ROOT}/wp-config.php" > /tmp/out && mv /tmp/out "${PROJECT_WEB_ROOT}/wp-config.php"
  9. <?php
  10. if (@$_SERVER['HTTP_HOST']) {
  11. define('WP_SITEURL', 'http://'.$_SERVER['HTTP_HOST']);
  12. define('WP_HOME', 'http://'.$_SERVER['HTTP_HOST']);
  13. }
  14. //if ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https'){
  15. // $_SERVER['HTTPS'] = 'on';
  16. // $_SERVER['SERVER_PORT'] = 443;
  17. //}
  18. define('FS_METHOD', 'direct');
  19. EOF