Browse Source

Add restart routine for IMAP_SYSTEM

Kristan Kenney 6 years ago
parent
commit
5ef49eadfe
1 changed files with 11 additions and 2 deletions
  1. 11 2
      bin/v-restart-mail

+ 11 - 2
bin/v-restart-mail

@@ -49,8 +49,17 @@ if [ -z "$MAIL_SYSTEM" ] || [ "$MAIL_SYSTEM" = 'remote' ]; then
     exit
 fi
 
-# Restart system
-service $MAIL_SYSTEM restart >/dev/null 2>&1
+# Restart IMAP system if present
+if [ ! -z "$IMAP_SYSTEM" ]; then
+    $BIN/v-restart-service $IMAP_SYSTEM > /dev/null 2>&1
+    if [ $? -ne 0 ]; then
+        send_email_report
+        check_result $E_RESTART "$IMAP_SYSTEM restart failed"
+    fi
+fi
+
+# Restart mail system
+$BIN/v-restart-service $MAIL_SYSTEM >/dev/null 2>&1
 if [ $? -ne 0 ]; then
     send_email_report
     check_result $E_RESTART "$MAIL_SYSTEM restart failed"