From 6c302f075bdf0ed990051fb8b8cdba7fadfd1127 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 20 Jun 2017 13:24:18 +0100 Subject: [PATCH] If we are about to reboot anyway then don't bother restarting daemons --- src/freedombone-logging | 21 +++++++++++++++------ src/freedombone-utils-final | 6 +++--- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/src/freedombone-logging b/src/freedombone-logging index 5e502a9b..09262656 100755 --- a/src/freedombone-logging +++ b/src/freedombone-logging @@ -244,6 +244,21 @@ else turn_off_rsys_logging fi +if [ -d /etc/exim4 ]; then + update-exim4.conf.template -r + update-exim4.conf + dpkg-reconfigure --frontend noninteractive exim4-config +fi + +if [[ "$2" == "--reboot"* || "$2" == "--restart"* ]]; then + # if we are rebooting anyway then there is no need to + # restart the daemons + exit 0 +fi + +if [ -d /etc/exim4 ]; then + systemctl restart exim4 +fi systemctl restart syslog if [ -d /etc/tor ]; then if [[ "$2" != "--onion" ]]; then @@ -260,12 +275,6 @@ fi if [ -d /etc/prosody ]; then systemctl restart prosody fi -if [ -d /etc/exim4 ]; then - update-exim4.conf.template -r - update-exim4.conf - dpkg-reconfigure --frontend noninteractive exim4-config - systemctl restart exim4 -fi if [ -d /etc/dovecot ]; then systemctl restart dovecot fi diff --git a/src/freedombone-utils-final b/src/freedombone-utils-final index 8b30da4a..085c3184 100755 --- a/src/freedombone-utils-final +++ b/src/freedombone-utils-final @@ -72,17 +72,17 @@ $(get_ssh_server_key) echo '' echo $'Shutting down the system. Detatch the ethernet cable, attach wifi dongle, then power on again.' echo '' - ${PROJECT_NAME}-logging off + ${PROJECT_NAME}-logging off --restart systemctl poweroff return fi echo $'Turning off logging' - ${PROJECT_NAME}-logging off + ${PROJECT_NAME}-logging off --restart echo $'Rebooting the system' systemctl reboot -i fi echo $'Turning off logging' - ${PROJECT_NAME}-logging off + ${PROJECT_NAME}-logging off --restart } function update_installed_apps_list {