summaryrefslogtreecommitdiff
path: root/www/onlyoffice-documentserver/files/patch-document-server-package_common_documentserver_bin_documentserver-flush-cache.sh.m4
blob: 92cb656f9917848230eb6f9cb0b1aa7c63bf1bde (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
--- document-server-package/common/documentserver/bin/documentserver-flush-cache.sh.m4.orig	2024-11-05 14:03:05.897987000 +0100
+++ document-server-package/common/documentserver/bin/documentserver-flush-cache.sh.m4
@@ -24,18 +24,16 @@ HASH=${HASH:-$(date +'%Y.%m.%d-%H%M' | openssl md5 | a
 HASH=${HASH:-$(date +'%Y.%m.%d-%H%M' | openssl md5 | awk '{print $2}')}
 
 # Save the hash to a variable in the configuration file
-echo "set \$cache_tag \"$HASH\";" > /etc/nginx/includes/ds-cache.conf
+echo "set \$cache_tag \"$HASH\";" > %%ETCDIR%%/documentserver/nginx/includes/ds-cache.conf
 
-API_PATH="/var/www/M4_DS_PREFIX/web-apps/apps/api/documents/api.js"
+API_PATH="%%LOCALBASE%%/www/M4_DS_PREFIX/web-apps/apps/api/documents/api.js"
 cp -f ${API_PATH}.tpl ${API_PATH}
-sed -i "s/{{HASH_POSTFIX}}/${HASH}/g" ${API_PATH}
-chown ds:ds ${API_PATH}
+sed -i '' "s/{{HASH_POSTFIX}}/${HASH}/g" ${API_PATH}
+chown onlyoffice:onlyoffice ${API_PATH}
 rm -f ${API_PATH}.gz
 
 if [ "$RESTART_CONDITION" != "false" ]; then
-    if (pgrep -x "systemd" > /dev/null) && systemctl is-active --quiet nginx; then
-        systemctl reload nginx
-    elif service nginx status > /dev/null 2>&1; then
+    if service nginx status > /dev/null 2>&1; then
         service nginx reload
     fi
 fi