Advertisement
Guest User

Untitled

a guest
Jan 29th, 2019
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. cd /Users/nmak/Sites/
  2.  
  3. echo "Enter Directory Name. Keep it in lowercase and no spaces. Use hyphens in place of it."
  4. read dirname
  5. # DB Info
  6. echo "Enter a database name omitting the wp_"
  7. read dbName
  8. echo "Enter Site Name"
  9. read sitename
  10.  
  11. cd "$dirname"
  12. echo "Moving to folder "$dirname" and installing WP."
  13. echo "Folders path is:"
  14. pwd
  15.  
  16. #Download Core
  17. wp core download
  18.  
  19. wp config create --dbname=wp_"$dbName" --dbuser=root --dbpass=dev
  20. wp db create
  21. if [ $? -eq 0 ]
  22. then
  23. echo "Good job, onto the next step!"
  24. else
  25. cd "$dirname" && rm -rf wp-config.php && cd ..
  26. echo "Database wp_\"$dbName\" exists. Please enter a another name"
  27. read dbName
  28. wp config create --dbname=wp_"$dbName" --dbuser=root --force
  29. wp db create
  30. if [ ! $? -eq 0 ]
  31. then
  32. echo "Check your databases to make sure you're not reusing the same ones. Closing shell script..."
  33. exit
  34. fi
  35. fi
  36.  
  37. #Site Build
  38.  
  39. wp core install --url="$dirname".app --title="$sitename" --admin_user=dev --admin_password=dev --admin_email=email@email.com
  40.  
  41. if [ ! $? -eq 0 ]
  42. then
  43. echo "FIX YOUR ERRORS!"
  44. echo "Enter Site Name"
  45. read sitename
  46. wp core install --url="$dirname".app --title="$sitename" --admin_user=dev --admin_password=dev --admin_email=email@email.com
  47. fi
  48.  
  49. echo "Finished, closing"
  50.  
  51. exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement