Browse Source

If we are about to reboot anyway then don't bother restarting daemons

Bob Mottram 7 years ago
parent
commit
6c302f075b
2 changed files with 18 additions and 9 deletions
  1. 15
    6
      src/freedombone-logging
  2. 3
    3
      src/freedombone-utils-final

+ 15
- 6
src/freedombone-logging View File

@@ -244,6 +244,21 @@ else
244 244
     turn_off_rsys_logging
245 245
 fi
246 246
 
247
+if [ -d /etc/exim4 ]; then
248
+    update-exim4.conf.template -r
249
+    update-exim4.conf
250
+    dpkg-reconfigure --frontend noninteractive exim4-config
251
+fi
252
+
253
+if [[ "$2" == "--reboot"* || "$2" == "--restart"* ]]; then
254
+    # if we are rebooting anyway then there is no need to
255
+    # restart the daemons
256
+    exit 0
257
+fi
258
+
259
+if [ -d /etc/exim4 ]; then
260
+    systemctl restart exim4
261
+fi
247 262
 systemctl restart syslog
248 263
 if [ -d /etc/tor ]; then
249 264
     if [[ "$2" != "--onion" ]]; then
@@ -260,12 +275,6 @@ fi
260 275
 if [ -d /etc/prosody ]; then
261 276
     systemctl restart prosody
262 277
 fi
263
-if [ -d /etc/exim4 ]; then
264
-    update-exim4.conf.template -r
265
-    update-exim4.conf
266
-    dpkg-reconfigure --frontend noninteractive exim4-config
267
-    systemctl restart exim4
268
-fi
269 278
 if [ -d /etc/dovecot ]; then
270 279
     systemctl restart dovecot
271 280
 fi

+ 3
- 3
src/freedombone-utils-final View File

@@ -72,17 +72,17 @@ $(get_ssh_server_key)
72 72
             echo ''
73 73
             echo $'Shutting down the system. Detatch the ethernet cable, attach wifi dongle, then power on again.'
74 74
             echo ''
75
-            ${PROJECT_NAME}-logging off
75
+            ${PROJECT_NAME}-logging off --restart
76 76
             systemctl poweroff
77 77
             return
78 78
         fi
79 79
         echo $'Turning off logging'
80
-        ${PROJECT_NAME}-logging off
80
+        ${PROJECT_NAME}-logging off --restart
81 81
         echo $'Rebooting the system'
82 82
         systemctl reboot -i
83 83
     fi
84 84
     echo $'Turning off logging'
85
-    ${PROJECT_NAME}-logging off
85
+    ${PROJECT_NAME}-logging off --restart
86 86
 }
87 87
 
88 88
 function update_installed_apps_list {