Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cd /Users/nmak/Sites/
- echo "Enter Directory Name. Keep it in lowercase and no spaces. Use hyphens in place of it."
- read dirname
- # DB Info
- echo "Enter a database name omitting the wp_"
- read dbName
- echo "Enter Site Name"
- read sitename
- cd "$dirname"
- echo "Moving to folder "$dirname" and installing WP."
- echo "Folders path is:"
- pwd
- #Download Core
- wp core download
- wp config create --dbname=wp_"$dbName" --dbuser=root --dbpass=dev
- wp db create
- if [ $? -eq 0 ]
- then
- echo "Good job, onto the next step!"
- else
- cd "$dirname" && rm -rf wp-config.php && cd ..
- echo "Database wp_\"$dbName\" exists. Please enter a another name"
- read dbName
- wp config create --dbname=wp_"$dbName" --dbuser=root --force
- wp db create
- if [ ! $? -eq 0 ]
- then
- echo "Check your databases to make sure you're not reusing the same ones. Closing shell script..."
- exit
- fi
- fi
- #Site Build
- wp core install --url="$dirname".app --title="$sitename" --admin_user=dev --admin_password=dev --admin_email=email@email.com
- if [ ! $? -eq 0 ]
- then
- echo "FIX YOUR ERRORS!"
- echo "Enter Site Name"
- read sitename
- wp core install --url="$dirname".app --title="$sitename" --admin_user=dev --admin_password=dev --admin_email=email@email.com
- fi
- echo "Finished, closing"
- exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement