Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function anchor_prep {
- mkdir ~/scripts
- read -p $'\e[31mDatabase name\e[0m: ' dbname
- read -p $'\e[31mDatabase password\e[0m: ' dbpw
- 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
- chmod +x ~/scripts/db_backup.sh
- mkdir ~/downloads
- cd ~/downloads
- read -p $'\e[31mWP Engine download link\e[0m: ' downloadlink
- wget $downloadlink
- filename=`ls site-*`
- unzip $filename
- rm -f $filename
- rm -rf ~/public/wp-content/ # Removes current wp-content
- mv ~/downloads/wp-content/ ~/public/wp-content/ # Restore wp-content from snapshot
- rm -rf ~/public/wp-content/mu-plugins
- rm -f ~/public/wp-content/advanced-cache.php
- rm -f ~/public/wp-content/object-cache.php
- cd ~/public/
- find . -type d -exec chmod 755 {} \;
- find . -type f -exec chmod 644 {} \;
- ~/scripts/db_backup.sh
- chmod 600 ~/public/wp-content/mysql.sql
- }
- anchor_prep
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement