Skip to content

Instantly share code, notes, and snippets.

@alexmoreno
Created October 20, 2016 14:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexmoreno/1b7dcc77ca5f517cc2ee65a32ba9bef1 to your computer and use it in GitHub Desktop.
Save alexmoreno/1b7dcc77ca5f517cc2ee65a32ba9bef1 to your computer and use it in GitHub Desktop.
echo "Setting new site $1"
directory="/var/www/html/$1"
echo "- Creating directory $1"
mkdir $directory
echo "- Copying backup files"
cp ~/base/kickstart.php $directory/kickstart.php
cp ~/base/base3.jpa $directory/base3.jpa
echo "- Setting up permissions"
sudo chmod -R 777 $directory
echo "- Setting up new database $1, you'll be asked for your MySQL root's password:"
mysql -u root -p -e "CREATE DATABASE $1"
echo "- Opening your kickstart.php in default browser (actually it's chromium-browser)"
chromium-browser --new-window "localhost/$1/kickstart.php"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment