blob: c0e759cd850eeea1d64746601868a37a794b2504 (
plain)
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
|
#!/bin/bash
echo "choose a password for the database:"
read input
echo "use xampp's version of mariadb? [y/n]"
read answer
if [[ $answer == 'y' ]] then
mariadb="/opt/lampp/bin/mariadb"
else
mariadb="mariadb"
fi
echo "use sudo? [y/n]"
read answer
if [[ $answer == 'y' ]] then
sudo="sudo"
fi
echo "creating database..."
$sudo $mariadb -u root <<EOF
$(cat scripts/create_user.sql)
EOF
echo '$input'
$sudo $mariadb -u root < ./scripts/create_db.sql
|