Browse Source

Update web domain suspension scripts

Kristan Kenney 6 years ago
parent
commit
8a6e7d0b31
2 changed files with 13 additions and 5 deletions
  1. 3 3
      bin/v-suspend-web-domain
  2. 10 2
      bin/v-unsuspend-web-domain

+ 3 - 3
bin/v-suspend-web-domain

@@ -71,9 +71,6 @@ if [ ! -z "$PROXY_SYSTEM" ] && [ ! -z "$PROXY" ]; then
     fi
 fi
 
-# Rebuild global domain configuration
-$BIN/v-rebuild-web-domain $user $domain 'no'
-
 #----------------------------------------------------------#
 #                       Hestia                             #
 #----------------------------------------------------------#
@@ -82,6 +79,9 @@ $BIN/v-rebuild-web-domain $user $domain 'no'
 update_object_value 'web' 'DOMAIN' "$domain" '$SUSPENDED' 'yes'
 increase_user_value "$user" '$SUSPENDED_WEB'
 
+# Update global configuration files
+$BIN/v-rebuild-web-domain $user $domain 'no'
+
 # Restarting web server
 $BIN/v-restart-web $restart
 check_result $? "Web restart failed" >/dev/null

+ 10 - 2
bin/v-unsuspend-web-domain

@@ -69,8 +69,13 @@ if [ ! -z "$PROXY_SYSTEM" ] && [ ! -z "$PROXY" ]; then
     fi
 fi
 
-# Rebuild global domain configuration
-$BIN/v-rebuild-web-domain $user $domain 'no'
+# Rebuilding backend configuration
+if [ ! -z "$WEB_BACKEND" ]; then
+    prepare_web_backend
+    delete_web_backend
+    template=$(get_object_value 'web' 'DOMAIN' "$domain" '$BACKEND')
+    $BIN/v-add-web-domain-backend $user $domain $template $restart
+fi
 
 #----------------------------------------------------------#
 #                       Hestia                             #
@@ -80,6 +85,9 @@ $BIN/v-rebuild-web-domain $user $domain 'no'
 update_object_value 'web' 'DOMAIN' "$domain" '$SUSPENDED' 'no'
 decrease_user_value "$user" '$SUSPENDED_WEB'
 
+# Update global configuration files
+$BIN/v-rebuild-web-domain $user $domain 'no'
+
 # Restarting web server
 $BIN/v-restart-web $restart
 check_result $? "Web restart failed" >/dev/null