mirror of
https://github.com/community-scripts/ProxmoxVE
synced 2025-01-10 19:05:09 +00:00
Update ghost version retrieval and configure MySQL with random password
This commit is contained in:
parent
739b47e9c3
commit
d402d4a635
@ -32,7 +32,7 @@ function update_script() {
|
|||||||
msg_info "Updating ${APP} LXC"
|
msg_info "Updating ${APP} LXC"
|
||||||
|
|
||||||
if command -v ghost &> /dev/null; then
|
if command -v ghost &> /dev/null; then
|
||||||
current_version=$(ghost --version | awk '{print $2}') #TO REVIEW
|
current_version=$(ghost version | grep 'Ghost-CLI version' | awk '{print $3}')
|
||||||
latest_version=$(npm show ghost-cli version)
|
latest_version=$(npm show ghost-cli version)
|
||||||
if [ "$current_version" != "$latest_version" ]; then
|
if [ "$current_version" != "$latest_version" ]; then
|
||||||
msg_info "Updating ${APP} from version $current_version to $latest_version"
|
msg_info "Updating ${APP} from version $current_version to $latest_version"
|
||||||
|
@ -31,8 +31,15 @@ $STD ufw allow 'Nginx Full'
|
|||||||
|
|
||||||
# Configure MySQL
|
# Configure MySQL
|
||||||
msg_info "Configuring MySQL"
|
msg_info "Configuring MySQL"
|
||||||
$STD mysql -u root -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH 'mysql_native_password' BY 'ghost';"
|
DB_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13)
|
||||||
|
$STD mysql -u root -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH 'mysql_native_password' BY '$DB_PASS';"
|
||||||
$STD mysql -u root -p'ghost' -e "FLUSH PRIVILEGES;"
|
$STD mysql -u root -p'ghost' -e "FLUSH PRIVILEGES;"
|
||||||
|
|
||||||
|
{
|
||||||
|
echo "MySQL-Credentials"
|
||||||
|
echo "Username: root"
|
||||||
|
echo "Password: $DB_PASS"
|
||||||
|
} >> ~/mysql.creds
|
||||||
msg_ok "Configured MySQL"
|
msg_ok "Configured MySQL"
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user