setup-db.sh 810 Bytes
Newer Older
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
#!/bin/bash

#
# Setup Database
#

# Set LOCK file location
LOCKFILE_DB=.engine.install-db.lock

# Check if databases are already set-up
if test -f "$LOCKFILE_DB"; then
  echo "Aura Engine Databases are already existing! Skipping..."
else
    echo "Setting up database ..."
    echo 
    echo "Which database system do you want to use? (Press '1' or '2')"
    echo "  [1] MariaDB"
    echo "  [2] Other / Manually"
    echo

    while true; do
    read -rsn1 input

    if [ "$input" = "1" ]; then
        echo "Creating DB for MariaDB ..."
26
        bash scripts/setup-db-mariadb.sh
27
28
29
30
31
32
33
34
35
36
37
        break
    fi
    if [ "$input" = "2" ]; then
        echo "Manual database setup selected."
        break
    fi
    done

    # Create lockfile to avoid accidential re-creation of the database
    touch $LOCKFILE_DB
fi