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.

20 lines
796 B

  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. rm -rf $HOME/public_html/latest.tar.gz
  9. mv $HOME/public_html/wp-config-sample.php $HOME/public_html/wp-config.php
  10. #edit wp-config with details
  11. user=$(whoami)
  12. echo "enter your mysql password"
  13. read PASS
  14. sed -i "s/database_name_here/$user/g" $HOME/public_html/wp-config.php
  15. sed -i "s/username_here/$user/g" $HOME/public_html/wp-config.php
  16. sed -i "s/password_here/$PASS/g" $HOME/public_html/wp-config.php
  17. sed -i "s/localhost/mysql.internal/g" $HOME/public_html/wp-config.php
  18. chmod 400 $HOME/public_html/wp-config.php