Let's say you want to host domains first.com and second.com.
Create folders for their files:
| #!/usr/bin/env bash | |
| ########################################################################## | |
| # Shellscript: Backup and update WordPress using wp-cli | |
| # Author : Paco Orozco <[email protected]> | |
| # Requires : wp-cli | |
| ########################################################################## | |
| # Changelog | |
| # 20170125: 1.0 | |
| # Adds a default option to upgrade only when it's needed. | |
| # 20161220: 0.1 |
| var string_to_slug = function (str) | |
| { | |
| str = str.replace(/^\s+|\s+$/g, ''); // trim | |
| str = str.toLowerCase(); | |
| // remove accents, swap ñ for n, etc | |
| var from = "àáäâèéëêìíïîòóöôùúüûñçěščřžýúůďťň·/_,:;"; | |
| var to = "aaaaeeeeiiiioooouuuuncescrzyuudtn------"; | |
| for (var i=0, l=from.length ; i<l ; i++) |
| <?php | |
| echo '<pre>'; | |
| echo '<span style="color:blue">DOWNLOADING...</span>'.PHP_EOL; | |
| // Download file | |
| file_put_contents('wp.zip', file_get_contents('https://wordpress.org/latest.zip')); | |
| $zip = new ZipArchive(); | |
| $res = $zip->open('wp.zip'); | |
| if ($res === TRUE) { |
| <?php | |
| /* | |
| * dl-file.php | |
| * | |
| * Protect uploaded files with login. | |
| * | |
| * @link http://wordpress.stackexchange.com/questions/37144/protect-wordpress-uploads-if-user-is-not-logged-in | |
| * | |
| * @author hakre <http://hakre.wordpress.com/> | |
| * @license GPL-3.0+ |