Added settings to permit plugin etc. installation

This commit is contained in:
Price Hiller 2021-08-22 16:44:47 -05:00
parent b0da4f039b
commit 1a84acf7de

View File

@ -137,9 +137,22 @@ dnf install php-mysqlnd php-dom php-simplexml php-xml php-xmlreader php-curl php
php-mbstring php-posix php-sockets php-tokenizer -y
log "info" "Finished installing optional php extensions"
log "info" "Installing php 7.4"
log "info" "Installing the EPEL repository"
dnf -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
log "info" "Installing the REMI repository"
dnf -y install https://rpms.remirepo.net/enterprise/remi-release-8.rpm
log "info" "Adding dnf-utils"
dnf -y install dnf-utils
log "info" "Initial setup done, installing php7.4"
dnf module reset php -y
dnf module install php:remi-7.4
dnf update
log "info" "PHP 7.4 should be installed, can be verifed with \"php -v\""
cd /tmp
server_name="example.20r"
server_name="20r.gg"
full_server_name="www.${server_name}"
nginx_server_config=/etc/nginx/conf.d/"${server_name}".conf
@ -250,6 +263,9 @@ curl https://wordpress.org/latest.tar.gz --output wordpress_latest.tar.gz \
&& cp "${server_sites_dir}"/wp-config-sample.php "${server_sites_dir}"/wp-config.php \
&& log "info" "Successfully installed wordpress"
log "info" "Setting proper permissions for wp-content so plugins etc. can be installed"
chmod -R 777 "${server_sites_dir}/wp-content" # can't be fucked to figure out the correct perms :shrug:
wp_config_location="${server_sites_dir}"/wp-config.php
while read -r line; do
if [[ "${line}" == "define( 'DB_NAME',"* ]]; then
@ -260,6 +276,9 @@ while read -r line; do
echo "define( 'DB_HOST', 'localhost' );"
elif [[ "${line}" == "define( 'DB_PASSWORD'"* ]]; then
echo "define( 'DB_PASSWORD', '${admin_localhost_password}' );"
elif [[ "${line}" == *"Add any custom values between this line and"* ]]; then
echo "${line}"
echo "define('FS_METHOD', 'direct'); // Allow plugins to be installed"
else
echo "${line}"
fi