diff options
author | nil <nil@tfwhyno.gf> | 2024-10-02 17:48:56 +0200 |
---|---|---|
committer | nil <nil@tfwhyno.gf> | 2024-10-02 17:48:56 +0200 |
commit | 0972fa6eab8c9111311f082ba8abfdc6b4a40945 (patch) | |
tree | 4eedbdc1a7cfdeee9d651c9871a9f26ab6da56d4 /scripts/create_db.sh | |
parent | 012c2c03b29a987ca4eead023ded22e01aa7477b (diff) |
commit changes
Diffstat (limited to 'scripts/create_db.sh')
-rw-r--r-- | scripts/create_db.sh | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/scripts/create_db.sh b/scripts/create_db.sh new file mode 100644 index 0000000..c0e759c --- /dev/null +++ b/scripts/create_db.sh @@ -0,0 +1,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 |