Browse Source

Fixes to z-push upgrade/install routine

Kristan Kenney 7 years ago
parent
commit
3afe5fe065
1 changed files with 12 additions and 2 deletions
  1. 12 2
      install/upgrade/0.9.8-29.sh

+ 12 - 2
install/upgrade/0.9.8-29.sh

@@ -107,12 +107,22 @@ if [ ! -z "$MAIL_SYSTEM" ]; then
     apt-get -qq -y install z-push-common z-push-backend-imap z-push-backend-combined z-push-autodiscover > /dev/null 2>&1
 
     # Copy configuration files
+    if [ -z /etc/z-push/ ]; then
+        echo "(I) Adding Z-Push configuration directory"
+        mkdir -p /etc/z-push/
+    fi
     cp -f $hestiacp/zpush/z-push.conf.php /etc/z-push/
     cp -f $hestiacp/zpush/imap.conf.php /etc/z-push/
 
     # Set permissions - chmod 777 needs further testing!
-    set_perms www-data www-data 777 /var/lib/z-push
-    set_perms www-data www-data 777 /var/log/z-push
+    if [ -z /var/log/z-push ]; then
+        echo "(I) Adding Z-Push logs directory"
+        mkdir -p /var/log/z-push
+    fi
+    chmod 777 /var/lib/z-push
+    chown -R www-data:www-data /var/lib/z-push
+    chmod 777 /var/log/z-push
+    chown -R www-data:www-data /var/log/z-push
 fi
 
 # Update default page templates