Guest User

Untitled

a guest
Feb 4th, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. ### variables ###
  2. # $1: folder, database, url, page-title
  3. # $2: mysql user
  4. # $3: mysql password
  5. # $4: admin_name
  6. # $5: admin_email
  7.  
  8. # create directory
  9. mkdir $1 && cd $1
  10.  
  11. # link valet
  12. valet link
  13.  
  14. # restart valet
  15. valet restart
  16.  
  17. # create database
  18. echo "Please enter your MYSQL Password:"
  19. echo "create database $1" | mysql -u root -p
  20. echo "✓ Database created."
  21.  
  22. # get latest wordpress
  23. wp core download;
  24. echo "✓ Wordpress Core downloaded."
  25.  
  26. # TODO: Edit wp-config.php
  27. db_name="database_name_here"
  28. db_name_new=$1
  29.  
  30. db_user="username_here"
  31. db_user_new=$2
  32.  
  33. db_pw="password_here"
  34. db_pw_new=$3
  35.  
  36. FILE="wp-config-sample.php"
  37.  
  38. sed -i '' -e 's/'$db_name'/'$db_name_new'/g' wp-config-sample.php
  39. sed -i '' -e 's/'$db_user'/'$db_user_new'/g' wp-config-sample.php
  40. sed -i '' -e 's/'$db_pw'/'$db_pw_new'/g' wp-config-sample.php
  41.  
  42. # Rename wp-config
  43. mv wp-config-sample.php wp-config.php;
  44.  
  45. # install wordpress
  46. wp core install --url=$1.test --title=$1 --admin_user=$4 --admin_email=$5
  47. echo "✓ Wordpress Installation."
  48.  
  49. # remove unnecessary plugins
  50. wp plugin delete hello akismet
  51. echo "✓ Deleted plugins."
  52.  
  53. # install standard plugins
  54. wp plugin install custom-post-type-ui
  55. wp plugin activate custom-post-type-ui
  56.  
  57. wp plugin install advanced-custom-fields
  58. wp plugin activate advanced-custom-fields
  59. echo "✓ Installed & activated plugins."
  60. echo "✓ All fine."
Add Comment
Please, Sign In to add comment