Advertisement
Guest User

Untitled

a guest
Feb 3rd, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. if [ ! -f ".env" ]; then
  2.  
  3. touch .env
  4.  
  5. echo -n "Enter the DBNAME and press [ENTER]: "
  6. read databasename
  7. echo -n "Enter the DBPREFIX and press [ENTER]: "
  8. read databaseprefix
  9. echo -n "Enter the WPURL and press [ENTER]: "
  10. read wordpressurl
  11. echo -n "Enter the WPTITLE and press [ENTER]: "
  12. read wordpresstitle
  13. echo -n "Enter the WPADMINEMAIL and press [ENTER]: " # Will entually remove this when we have a name.
  14. read wordpressadminemail
  15. echo -n "Enter the BBUSER and press [ENTER]: "
  16. read bitbucketuser
  17.  
  18. wpconfig=( "DBHOST=localhost" "DBNAME=$databasename" "DBUSER=root" "DBPASS=root" "DBPREFIX=$databaseprefix" "WPURL=$wordpressurl" "WPSITETITLE=$wordpresstitle" "WPADMINUSER=jake" "WPADMINPASS=password" "WPADMINEMAIL=$wordpressadminemail" "BBUSER=$bitbucketuser" )
  19.  
  20. for i in "${wpconfig[@]}"
  21. do
  22. printf "%sn" "$i"
  23. done > .env
  24.  
  25. else
  26.  
  27. while read -r line
  28. do
  29. declare global "$line"
  30. done < .env
  31.  
  32. detailsList=( 'DBHOST' 'DBNAME' 'DBUSER' 'DBPASS' 'DBPREFIX' 'WPURL' 'WPSITETITLE' 'WPADMINUSER' 'WPADMINPASS' 'WPADMINEMAIL' 'BBUSER' )
  33.  
  34. for i in "${detailsList[@]}"
  35. do
  36. if [ -z "${!i}" ]; then
  37.  
  38. echo "'$i' is not set"
  39. exit
  40.  
  41. fi
  42. done
  43.  
  44. echo $DBNAME;
  45. fi
  46.  
  47. if [ "$ACTION" = "init" ]; then
  48.  
  49. checkDirectory
  50. clearDetails
  51. checkDetails
  52. downloadWP
  53. configWP
  54. installWP
  55. emptySite
  56. sudo chown user:_www *
  57. sudo chmod -R 775 *
  58.  
  59. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement