Browse Source

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

Bob Mottram 8 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
     turn_off_rsys_logging
244
     turn_off_rsys_logging
245
 fi
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
 systemctl restart syslog
262
 systemctl restart syslog
248
 if [ -d /etc/tor ]; then
263
 if [ -d /etc/tor ]; then
249
     if [[ "$2" != "--onion" ]]; then
264
     if [[ "$2" != "--onion" ]]; then
260
 if [ -d /etc/prosody ]; then
275
 if [ -d /etc/prosody ]; then
261
     systemctl restart prosody
276
     systemctl restart prosody
262
 fi
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
 if [ -d /etc/dovecot ]; then
278
 if [ -d /etc/dovecot ]; then
270
     systemctl restart dovecot
279
     systemctl restart dovecot
271
 fi
280
 fi

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

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