Просмотр исходного кода

Update and rename v-purge-web-domain-nginx-cache to v-purge-nginx-cache

Alexandros Ioannides 5 лет назад
Родитель
Сommit
c1f01c983e
1 измененных файлов с 13 добавлено и 12 удалено
  1. 13 12
      bin/v-purge-nginx-cache

+ 13 - 12
bin/v-purge-web-domain-nginx-cache → bin/v-purge-nginx-cache

@@ -1,11 +1,11 @@
 #!/bin/bash
-# info: Empty nginx cache
+# info: Purge nginx cache
 # options: USER DOMAIN MODE
 # labels: hestia web
 #
-# example: v-purge-web-domain-nginx-cache user domain.tld proxy
+# example: v-purge-nginx-cache user domain.tld proxy
 #
-# The function clears Nginx cache.
+# The function purges nginx cache.
 
 #----------------------------------------------------------#
 #                    Variable&Function                     #
@@ -34,7 +34,6 @@ is_object_valid 'web' 'DOMAIN' "$domain" "$FASTCGI_CACHE"
 # Perform verification if read-only mode is enabled
 check_hestia_demo_mode
 
-
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#
@@ -42,14 +41,16 @@ check_hestia_demo_mode
 # Load domain data
 parse_object_kv_list $(grep "DOMAIN='$domain'" $USER_DATA/web.conf)
 
-# Empty Fast CGI Cache 
-if [ -d /var/cache/nginx/php-fpm/$domain ]; then
-    rm -fr /var/cache/nginx/php-fpm/$domain/*
+# Purge nginx FastCGI cache
+if [ -d /var/cache/nginx/micro/$domain ]; then
+    rm -fr /var/cache/nginx/micro/$domain
 fi
-# Empty Proxy Cache
+
+# Purge nginx proxy cache
 if [ -d /var/cache/nginx/$domain ]; then
-    rm -fr /var/cache/nginx/$domain/*
+    rm -fr /var/cache/nginx/$domain
 fi
+
 #----------------------------------------------------------#
 #                       Hestia                             #
 #----------------------------------------------------------#
@@ -57,11 +58,11 @@ fi
 # Restart services if requested
 if [ ! -z "$restart" ]; then
     $BIN/v-restart-web
-    check_result $? "Web restart failed" >/dev/null
+    check_result $? "Web restart failed" > /dev/null
 fi
 
 # Logging
-log_history "purged nginx cache for $domain"
+log_history "Purged nginx cache for $domain"
 log_event "$OK" "$ARGUMENTS"
 
-exit
+exit