directus db
This commit is contained in:
parent
24d93ecf44
commit
15e2b819a2
20
install.sh
20
install.sh
|
@ -98,7 +98,6 @@ if [[ "$answer" == "y" ]]; then
|
|||
echo -e "${PURPLE}${BOLD}Enter the MariaDB root password : ${RESET}"
|
||||
read -s db_root_password
|
||||
echo
|
||||
echo -e "${PURPLE}${BOLD}${db_root_password}${RESET}"
|
||||
apt -y install expect
|
||||
SECURE_MYSQL=$(expect -c "
|
||||
set timeout 3
|
||||
|
@ -110,9 +109,9 @@ if [[ "$answer" == "y" ]]; then
|
|||
expect \"Change the root password? \\[Y/n\\]\"
|
||||
send \"y\r\"
|
||||
expect \"New password:\"
|
||||
send \"${db_root_password}\r\"
|
||||
send \"$db_root_password\r\"
|
||||
expect \"Re-enter new password:\"
|
||||
send \"${db_root_password}\r\"
|
||||
send \"$db_root_password\r\"
|
||||
expect \"Remove anonymous users?\"
|
||||
send \"y\r\"
|
||||
expect \"Disallow root login remotely?\"
|
||||
|
@ -128,8 +127,21 @@ if [[ "$answer" == "y" ]]; then
|
|||
# https://gist.github.com/coderua/5592d95970038944d099
|
||||
fi
|
||||
|
||||
#
|
||||
# DIRECTUS DB
|
||||
#
|
||||
|
||||
echo -e "${PURPLE}${BOLD}Setup Directus database ? (y/n) ${RESET}"
|
||||
read answer
|
||||
if [[ "$answer" == "y" ]]; then
|
||||
echo "yooooo"
|
||||
echo -e "${PURPLE}${BOLD}Generate and store the password somewhere safe${RESET}"
|
||||
echo -e "${PURPLE}${BOLD}Enter the MariaDB Directus password : ${RESET}"
|
||||
read -s db_directus_password
|
||||
echo
|
||||
mysql -u root -p <<EOF
|
||||
CREATE USER 'directus'@'localhost' IDENTIFIED BY '${db_password}';
|
||||
CREATE DATABASE directus;
|
||||
GRANT ALL PRIVILEGES ON directus.* TO 'directus'@'localhost' IDENTIFIED BY '${db_password}';
|
||||
FLUSH PRIVILEGES;
|
||||
EOF
|
||||
fi
|
Loading…
Reference in New Issue