scripts for helpdesk talks
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.

setupWordpress 905B

1234567891011121314151617181920
  1. #!/bin/bash
  2. mkdir "$HOME/public_html/oldSite"
  3. mv "$HOME/public_html/*" "$HOME/public_html/oldSite"
  4. curl https://wordpress.org/latest.tar.gz -o "$HOME/latest.tar.gz"
  5. touch "$HOME/public_html/.htaccess"
  6. chmod 755 "$HOME/public_html/.htaccess"
  7. tar -pxzvf "$HOME/latest.tar.gz" -C "$HOME/public_html/"
  8. mv "$HOME/public_html/wordpress/*" "$HOME/public_html/"
  9. rm -rf "$HOME/latest.tar.gz" "$HOME/public_html/wordpress"
  10. mv "$HOME/public_html/wp-config-sample.php" "$HOME/public_html/wp-config.php"
  11. #edit wp-config with details
  12. user=$(whoami)
  13. echo "enter your mysql password"
  14. read -r PASS
  15. sed -i "s/database_name_here/$user/g" "$HOME/public_html/wp-config.php"
  16. sed -i "s/username_here/$user/g" "$HOME/public_html/wp-config.php"
  17. sed -i "s/password_here/$PASS/g" "$HOME/public_html/wp-config.php"
  18. sed -i "s/localhost/mysql.internal/g" "$HOME/public_html/wp-config.php"
  19. chmod 400 "$HOME/public_html/wp-config.php"