Skip to content

Commit

Permalink
minor improvs
Browse files Browse the repository at this point in the history
Minor final improvements.
  • Loading branch information
QROkes committed Nov 12, 2021
1 parent 3396f76 commit 3fa0615
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 10 deletions.
7 changes: 3 additions & 4 deletions lib/bkp
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ check_exported_conf() {
fi
if tar -tvf $file --absolute-names | grep -oq "/opt/webinoly/templates/source/pph_webinoly.data"; then
tar -C / -xf $file /opt/webinoly/templates/source/pph_webinoly.data --absolute-names
sudo webinoly -header-permission-policy=on
sudo webinoly -header-permissions-policy=on
fi
if tar -tvf $file --absolute-names | grep -oq "/opt/webinoly/templates/source/cch_webinoly.data"; then
tar -C / -xf $file /opt/webinoly/templates/source/cch_webinoly.data --absolute-names
Expand Down Expand Up @@ -712,7 +712,7 @@ export_site() {
fi

# Check if site contains WP in subfolders and include these db's.
for sit in "/etc/nginx/apps.d/$siteto_"*-wpcommon.conf
for sit in "/etc/nginx/apps.d/${siteto}_"*-wpcommon.conf
do
local suby="/$(echo $sit | cut -f 2- -d "_" -s | cut -f -1 -d "-" -s | sed "s/_/\//g")"
if [[ -n $suby && -f /var/www/$siteto/htdocs$suby/wp-config.php ]]; then
Expand Down Expand Up @@ -824,8 +824,7 @@ import_site() {

# Remove old configurations
remove_nginx_default_server $domain
source /opt/webinoly/lib/site-ssl
[[ $(is_ssl $domain) == "true" ]] && revoke="off" && site_ssl_off > /dev/null 2>&1
[[ $(is_ssl $domain) == "true" ]] && sudo site $domain -ssl=off -revoke=off > /dev/null 2>&1


if [[ $(conf_read php) != "true" && ( $(is_wp $domain) == "true" || $(is_php $domain) == "true" ) ]]; then
Expand Down
2 changes: 2 additions & 0 deletions lib/general
Original file line number Diff line number Diff line change
Expand Up @@ -1023,9 +1023,11 @@ FLUSH PRIVILEGES;
_EOF_
else
echo "${red}${dim}[ERROR] WordPress Multisite database cannot be updated!${end}" >&2
return 1
fi
else
echo "${red}${dim}[ERROR] WordPress Multisite database cannot be updated!${end}" >&2
return 1
fi
fi
}
Expand Down
2 changes: 1 addition & 1 deletion lib/install
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ fastcgi_param HTTP_ACCEPT_ENCODING "";
[[ -n $(conf_read header-referrer) ]] && sudo webinoly -header-referrer=$(conf_read header-referrer)
[[ -n $(conf_read header-hsts) ]] && sudo webinoly -header-hsts=$(conf_read header-hsts)
[[ -s /opt/webinoly/templates/source/csp_webinoly.data ]] && sudo webinoly -header-csp=on
[[ -s /opt/webinoly/templates/source/pph_webinoly.data ]] && sudo webinoly -header-permission-policy=on
[[ -s /opt/webinoly/templates/source/pph_webinoly.data ]] && sudo webinoly -header-permissions-policy=on
[[ -s /opt/webinoly/templates/source/cch_webinoly.data ]] && sudo webinoly -header-cache-control=on
[[ -s /opt/webinoly/templates/source/rob_webinoly.data ]] && sudo webinoly -header-robots=on
[[ $(conf_read header-xssp) == "false" ]] && sudo webinoly -header-xssp=off
Expand Down
14 changes: 9 additions & 5 deletions lib/sites
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ deletesite_subfolder() {
fi

sudo rm -rf /var/www/$domain/htdocs$subfolder
echo "${gre}Subfolder${blu} $subfolder ${gre}from${blu} $domain ${gre}has been successfully deleted!${end}"
echo "${gre}Subfolder successfully removed!${end}"
}


Expand Down Expand Up @@ -1192,8 +1192,12 @@ parked_domain() {
echo "${red}${dim}[ERROR] Domain Mapping failed because WP blog ID cannot be 1 (main site)! ${end}"
elif [[ -n $domain_mapping_wp_id && $domain_mapping_wp_id =~ ^[0-9]+$ && $(is_wp_multisite $parked) =~ ^(subdomain|subdirectory)$ ]]; then
edit_wp_db_url_multisite $parked $domain $domain_mapping_wp_id
edit_wp_db_url $domain "http://${domain}"
echo "${gre}${dim}Domain Mapping successfully configured! ${end}"
if [[ $? != 1 ]]; then
edit_wp_db_url $domain "http://${domain}"
echo "${gre}${dim}Domain Mapping successfully configured! ${end}"
else
echo "${red}Domain Mapping configuration failed! ${end}"
fi
elif [[ -n $domain_mapping_wp_id && $domain_mapping_wp_id =~ ^[0-9]+$ ]]; then
echo "${red}${dim}[ERROR] Domain Mapping failed because main site is not a Multisite Network! ${end}"
elif [[ -n $domain_mapping_wp_id ]]; then
Expand Down Expand Up @@ -1622,7 +1626,7 @@ cloning_site() {

# Clone Subfolder conf files from apps.d
conf_write nginx-reload false
for appfile in /etc/nginx/apps.d/$clone_from*.conf
for appfile in /etc/nginx/apps.d/${clone_from}*.conf
do
if [[ -s $appfile ]]; then
local newfile=$(echo $appfile | sed "s/$clone_from/$domain/")
Expand Down Expand Up @@ -1678,7 +1682,7 @@ cloning_site() {

# Remove custom settings from cloned site
sudo site $domain -subdomain=false -force-redirect=off > /dev/null 2>&1
[[ $(is_ssl $clone_from) == "true" ]] && revoke="off" && site_ssl_off > /dev/null 2>&1
[[ $(is_ssl $clone_from) == "true" ]] && sudo site $domain -ssl=off -revoke=off -no-db-update > /dev/null 2>&1
[[ $(conf_read default-site) == $clone_from ]] && remove_nginx_default_server $domain
conf_delete nginx-reload

Expand Down

0 comments on commit 3fa0615

Please sign in to comment.