|
1 | 1 | #!/bin/bash |
2 | | -# info: remove fast cgi nginx support |
| 2 | +# info: Remove FastCGI nginx support |
3 | 3 | # options: USER DOMAIN [RESTART] |
4 | 4 | # labels: hestia web |
5 | 5 | # |
6 | | -# example: v-delete-web-domain-fast-cgi-cache user domain.tld |
| 6 | +# example: v-delete-fastcgi-cache user domain.tld |
7 | 7 | # |
8 | | -# The function removes fast cgi cache. |
| 8 | +# The function enables FastCGI cache for nginx |
| 9 | + |
9 | 10 |
|
10 | 11 | #----------------------------------------------------------# |
11 | 12 | # Variable&Function # |
@@ -41,16 +42,17 @@ check_hestia_demo_mode |
41 | 42 | # Load domain data |
42 | 43 | parse_object_kv_list $(grep "DOMAIN='$domain'" $USER_DATA/web.conf) |
43 | 44 |
|
44 | | -# Remove fast cgi configs |
| 45 | +# Remove FastCGI cache configuration |
45 | 46 | if [ -f $HOMEDIR/$user/conf/web/$domain/$WEB_SYSTEM.fastcgi_cache.conf ]; then |
46 | 47 | rm -f $HOMEDIR/$user/conf/web/$domain/$WEB_SYSTEM.fastcgi_cache.conf |
47 | 48 | fi |
48 | 49 |
|
49 | | -# Delete cache folder on disabling |
50 | | -if [ -d /var/cache/nginx/php-fpm/$domain ]; then |
51 | | - rm -rf /var/cache/nginx/php-fpm/$domain |
| 50 | +# Delete FastCGI cache folder |
| 51 | +if [ -d /var/cache/nginx/micro/$domain ]; then |
| 52 | + rm -rf /var/cache/nginx/micro/$domain |
52 | 53 | fi |
53 | 54 |
|
| 55 | + |
54 | 56 | #----------------------------------------------------------# |
55 | 57 | # Hestia # |
56 | 58 | #----------------------------------------------------------# |
|
62 | 64 | # Set FASTCGI flag to disabled |
63 | 65 | update_object_value 'web' 'DOMAIN' "$domain" '$FASTCGI_CACHE' '' |
64 | 66 |
|
65 | | -# Restart services if requested |
| 67 | +# Restart web server |
66 | 68 | if [ ! -z "$restart" ]; then |
67 | 69 | $BIN/v-restart-web |
68 | | - check_result $? "Web restart failed" >/dev/null |
| 70 | + check_result $? "Web server restart failed" > /dev/null |
69 | 71 | fi |
70 | 72 |
|
71 | 73 | # Logging |
72 | | -log_history "disabled fast cgi support for $domain" |
| 74 | +log_history "Disabled FastCGI cache for $domain" |
73 | 75 | log_event "$OK" "$ARGUMENTS" |
74 | 76 |
|
75 | 77 | exit |
0 commit comments