-
Notifications
You must be signed in to change notification settings - Fork 0
/
sript.sh
31 lines (26 loc) · 850 Bytes
/
sript.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#! /bin/bash
composer install
composer dump-autoload
echo 'Rewrite config file'
echo 'DB_HOST:'
read DB_HOST
echo 'DB_PORT:'
read DB_PORT
echo 'DB_NAME:'
read DB_NAME
echo 'DB_USERNAME:'
read DB_USERNAME
echo 'DB_PASSWORD:'
read -s DB_PASSWORD
MYSQL_PWD=$DB_PASSWORD mysql -u $DB_USERNAME -e "CREATE DATABASE $DB_NAME;"
MYSQL_PWD=$DB_PASSWORD mysql -u $DB_USERNAME "$DB_NAME"<./schema/schema.sql
touch config/config.php
echo '<?php'>config/config.php
echo '$DB_HOST = "'$DB_HOST'";' >> config/config.php
echo '$DB_PORT = "'$DB_PORT'";' >> config/config.php
echo '$DB_NAME = "'$DB_NAME'";' >> config/config.php
echo '$DB_USERNAME = "'$DB_USERNAME'";' >> config/config.php
echo '$DB_PASSWORD = "'$DB_PASSWORD'";' >> config/config.php
echo '?>'>>config/config.php
cd public
php -S localhost:8080