Update test.sh
This commit is contained in:
parent
7c90de611e
commit
8280d1756a
16
test.sh
16
test.sh
|
@ -27,8 +27,22 @@ tar xzvf latest.tar.gz
|
||||||
cp /tmp/wordpress/wp-config-sample.php /tmp/wordpress/wp-config.php
|
cp /tmp/wordpress/wp-config-sample.php /tmp/wordpress/wp-config.php
|
||||||
|
|
||||||
# Replace DB credentials in wp-config.php
|
# Replace DB credentials in wp-config.php
|
||||||
nano /tmp/wordpress/wp-config.php
|
#nano /tmp/wordpress/wp-config.php
|
||||||
|
CONFIG_FILE="/tmp/wordpress/wp-config.php"
|
||||||
|
|
||||||
|
# Backup the original file
|
||||||
|
cp "$CONFIG_FILE" "$CONFIG_FILE.bak"
|
||||||
|
|
||||||
|
# Replace DB_NAME
|
||||||
|
sed -i "s/define( 'DB_NAME', '.*' );/define( 'DB_NAME', '$DB_NAME' );/" "$CONFIG_FILE"
|
||||||
|
|
||||||
|
# Replace DB_USER
|
||||||
|
sed -i "s/define( 'DB_USER', '.*' );/define( 'DB_USER', '$DB_USER' );/" "$CONFIG_FILE"
|
||||||
|
|
||||||
|
# Replace DB_PASSWORD
|
||||||
|
sed -i "s/define( 'DB_PASSWORD', '.*' );/define( 'DB_PASSWORD', '$DB_PASSWORD' );/" "$CONFIG_FILE"
|
||||||
|
|
||||||
|
echo "wp-config.php has been updated."
|
||||||
# ====== Deploy WordPress ======
|
# ====== Deploy WordPress ======
|
||||||
rsync -avP /tmp/wordpress/ /var/www/html/
|
rsync -avP /tmp/wordpress/ /var/www/html/
|
||||||
chown -R www-data:www-data /var/www/html/
|
chown -R www-data:www-data /var/www/html/
|
||||||
|
|
Loading…
Reference in New Issue