Advertisement
Guest User

Untitled

a guest
Jun 11th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. function anchor_prep {
  2. mkdir ~/scripts
  3. read -p $'\e[31mDatabase name\e[0m: ' dbname
  4. read -p $'\e[31mDatabase password\e[0m: ' dbpw
  5. echo -e "dbpw=$dbpw\ndbuser=$dbname\ndbname=$dbname\nmysqldump --user=\$dbuser --password=\$dbpw --no-create-db --databases \$dbname > ~/public/wp-content/mysql.sql" > ~/scripts/db_backup.sh
  6. chmod +x ~/scripts/db_backup.sh
  7. mkdir ~/downloads
  8. cd ~/downloads
  9. read -p $'\e[31mWP Engine download link\e[0m: ' downloadlink
  10. wget $downloadlink
  11. filename=`ls site-*`
  12. unzip $filename
  13. rm -f $filename
  14. rm -rf ~/public/wp-content/ # Removes current wp-content
  15. mv ~/downloads/wp-content/ ~/public/wp-content/ # Restore wp-content from snapshot
  16. rm -rf ~/public/wp-content/mu-plugins
  17. rm -f ~/public/wp-content/advanced-cache.php
  18. rm -f ~/public/wp-content/object-cache.php
  19. cd ~/public/
  20. find . -type d -exec chmod 755 {} \;
  21. find . -type f -exec chmod 644 {} \;
  22. ~/scripts/db_backup.sh
  23. chmod 600 ~/public/wp-content/mysql.sql
  24. }
  25. anchor_prep
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement