Skip to content

Commit c1f01c9

Browse files
author
Alexandros Ioannides
authored
Update and rename v-purge-web-domain-nginx-cache to v-purge-nginx-cache
1 parent b543ea2 commit c1f01c9

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed
Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#!/bin/bash
2-
# info: Empty nginx cache
2+
# info: Purge nginx cache
33
# options: USER DOMAIN MODE
44
# labels: hestia web
55
#
6-
# example: v-purge-web-domain-nginx-cache user domain.tld proxy
6+
# example: v-purge-nginx-cache user domain.tld proxy
77
#
8-
# The function clears Nginx cache.
8+
# The function purges nginx cache.
99

1010
#----------------------------------------------------------#
1111
# Variable&Function #
@@ -34,34 +34,35 @@ is_object_valid 'web' 'DOMAIN' "$domain" "$FASTCGI_CACHE"
3434
# Perform verification if read-only mode is enabled
3535
check_hestia_demo_mode
3636

37-
3837
#----------------------------------------------------------#
3938
# Action #
4039
#----------------------------------------------------------#
4140

4241
# Load domain data
4342
parse_object_kv_list $(grep "DOMAIN='$domain'" $USER_DATA/web.conf)
4443

45-
# Empty Fast CGI Cache
46-
if [ -d /var/cache/nginx/php-fpm/$domain ]; then
47-
rm -fr /var/cache/nginx/php-fpm/$domain/*
44+
# Purge nginx FastCGI cache
45+
if [ -d /var/cache/nginx/micro/$domain ]; then
46+
rm -fr /var/cache/nginx/micro/$domain
4847
fi
49-
# Empty Proxy Cache
48+
49+
# Purge nginx proxy cache
5050
if [ -d /var/cache/nginx/$domain ]; then
51-
rm -fr /var/cache/nginx/$domain/*
51+
rm -fr /var/cache/nginx/$domain
5252
fi
53+
5354
#----------------------------------------------------------#
5455
# Hestia #
5556
#----------------------------------------------------------#
5657

5758
# Restart services if requested
5859
if [ ! -z "$restart" ]; then
5960
$BIN/v-restart-web
60-
check_result $? "Web restart failed" >/dev/null
61+
check_result $? "Web restart failed" > /dev/null
6162
fi
6263

6364
# Logging
64-
log_history "purged nginx cache for $domain"
65+
log_history "Purged nginx cache for $domain"
6566
log_event "$OK" "$ARGUMENTS"
6667

67-
exit
68+
exit

0 commit comments

Comments
 (0)