Update updated_install2.sh
This commit is contained in:
parent
16d2f47818
commit
07f13fae38
|
@ -2,21 +2,8 @@
|
|||
|
||||
# ====== CONFIGURATION ======
|
||||
DB_PASSWORD="changeme123" # <- Set your database password here
|
||||
# ============================
|
||||
|
||||
# Create wp-config.php from the sample
|
||||
sudo -u www-data cp /srv/www/wordpress/wp-config-sample.php /srv/www/wordpress/wp-config.php
|
||||
|
||||
# Replace database settings
|
||||
sudo -u www-data sed -i 's/database_name_here/wordpress/' /srv/www/wordpress/wp-config.php
|
||||
sudo -u www-data sed -i 's/username_here/wordpress/' /srv/www/wordpress/wp-config.php
|
||||
sudo -u www-data sed -i "s/password_here/${DB_PASSWORD}/" /srv/www/wordpress/wp-config.php
|
||||
|
||||
# Path to config
|
||||
WP_CONFIG="/srv/www/wordpress/wp-config.php"
|
||||
|
||||
# Delete existing placeholder salts
|
||||
sed -i "/AUTH_KEY/d;/SECURE_AUTH_KEY/d;/LOGGED_IN_KEY/d;/NONCE_KEY/d;/AUTH_SALT/d;/SECURE_AUTH_SALT/d;/LOGGED_IN_SALT/d;/NONCE_SALT/d" "$WP_CONFIG"
|
||||
|
||||
# Fetch and append new salts from the WordPress API
|
||||
curl -s https://api.wordpress.org/secret-key/1.1/salt/ >> "$WP_CONFIG"
|
||||
rsync -avP /tmp/wordpress/ /var/www/html/
|
||||
chown -R www-data:www-data /var/www/html/
|
||||
chmod -R 755 /var/www/html/
|
||||
rm index.html
|
Loading…
Reference in New Issue