From 38ec1b872f73fa4f531f14c3c943e58ca3d836c2 Mon Sep 17 00:00:00 2001 From: isscbta <53144593+isscbta@users.noreply.github.com> Date: Thu, 16 Feb 2023 21:04:20 +0100 Subject: [PATCH] Update v-activate-rocket-nginx --- bin/v-activate-rocket-nginx | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/bin/v-activate-rocket-nginx b/bin/v-activate-rocket-nginx index 770cb8662..f42a1fc34 100644 --- a/bin/v-activate-rocket-nginx +++ b/bin/v-activate-rocket-nginx @@ -73,14 +73,24 @@ fi #----------------------------------------------------------# # Changing Proxy Template -echo "Do you want to force-https in your Proxy Template or not (y/n):" -read answer -if [ "$answer" == "y" ]; then - /usr/local/vesta/bin/v-change-web-domain-proxy-tpl "$user" "$domain" "wprocket-force-https" +# Check if the proxy template is already set correctly +current_template=$(/usr/local/vesta/bin/v-list-web-domain $user $domain | grep 'PROXY:' | awk '{print $2}') +if [ "$current_template" == "wprocket-force-https" ] || [ "$current_template" == "wprocket-hosting" ]; then + echo "Proxy Template is already set up correctly" else - /usr/local/vesta/bin/v-change-web-domain-proxy-tpl "$user" "$domain" "wprocket-hosting" + # Prompt the user to choose whether to force HTTPS or not + echo "Do you want to force-https in your Proxy Template or not (y/n):" + read answer + + # Change the proxy template based on the user's choice + if [ "$answer" == "y" ]; then + /usr/local/vesta/bin/v-change-web-domain-proxy-tpl "$user" "$domain" "wprocket-force-https" + else + /usr/local/vesta/bin/v-change-web-domain-proxy-tpl "$user" "$domain" "wprocket-hosting" + fi + + echo "Proxy Template is ready" fi -echo "Proxy Template is ready" # Disabling wp-cron in wp-config.php cd /home/$user/web/$domain/public_html