Skip to content

Commit 376fd65

Browse files
authored
Update ghost-install.sh
1 parent 5855cff commit 376fd65

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

install/ghost-install.sh

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,20 @@ $STD apt-get install -y \
2727
msg_ok "Installed Dependencies"
2828

2929

30-
msg_info "Configuring MySQL"
30+
msg_info "Configuring Database"
31+
DB_NAME=ghost
32+
DB_USER=ghostuser
3133
DB_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13)
32-
$STD mysql -u root -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH 'mysql_native_password' BY '$DB_PASS';"
33-
$STD mysql -u root -p"$DB_PASS" -e "FLUSH PRIVILEGES;"
34+
mariadb -u root -e "CREATE DATABASE $DB_NAME;"
35+
mariadb -u root -e "CREATE USER '$DB_USER'@'localhost' IDENTIFIED BY '$DB_PASS';"
36+
mariadb -u root -e "GRANT ALL ON $DB_NAME.* TO '$DB_USER'@'localhost'; FLUSH PRIVILEGES;"
37+
3438
{
35-
echo "MySQL-Credentials"
36-
echo "Username: root"
37-
echo "Password: $DB_PASS"
38-
} >> ~/mysql.creds
39+
echo "Ghost-Credentials"
40+
echo "Ghost Database User: $DB_USER"
41+
echo "Ghost Database Password: $DB_PASS"
42+
echo "Ghost Database Name: $DB_NAME"
43+
} >> ~/ghost.creds
3944
msg_ok "Configured MySQL"
4045

4146
msg_info "Setting up Node.js Repository"

0 commit comments

Comments
 (0)