Optimized Shell SCript
parent
df02b2aabb
commit
3bc7e9fc09
|
@ -68,7 +68,7 @@ echo "Creating WordPress database and user with the new root password..."
|
||||||
mysql -u root -p"$new_root_password" <<EOF
|
mysql -u root -p"$new_root_password" <<EOF
|
||||||
CREATE DATABASE ${DB_NAME};
|
CREATE DATABASE ${DB_NAME};
|
||||||
CREATE USER '${DB_USER}'@'${DB_HOST}' IDENTIFIED BY '${DB_PASSWORD}';
|
CREATE USER '${DB_USER}'@'${DB_HOST}' IDENTIFIED BY '${DB_PASSWORD}';
|
||||||
GRANT ALL PRIVILEGES ON ${DB_NAME}.* TO '${DB_USER}'@'${DB_HOST}' IDENTIFIED BY '${DB_PASSWORD}';
|
GRANT ALL PRIVILEGES ON ${DB_NAME}.* TO '${DB_USER}'@'${DB_HOST}';
|
||||||
FLUSH PRIVILEGES;
|
FLUSH PRIVILEGES;
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
@ -80,9 +80,6 @@ else
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Re-Start the MariaDB service normally
|
|
||||||
sudo systemctl start mariadb
|
|
||||||
|
|
||||||
# Backup the wp-config.php file before making changes
|
# Backup the wp-config.php file before making changes
|
||||||
WP_CONFIG="/var/www/webroot/ROOT/wp-config.php"
|
WP_CONFIG="/var/www/webroot/ROOT/wp-config.php"
|
||||||
sudo cp $WP_CONFIG $WP_CONFIG.bak
|
sudo cp $WP_CONFIG $WP_CONFIG.bak
|
||||||
|
|
Loading…
Reference in New Issue