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

This commit is contained in:
Bob Mottram 2017-06-20 13:24:18 +01:00
parent c49e53eaee
commit 6c302f075b
2 changed files with 18 additions and 9 deletions

View File

@ -244,6 +244,21 @@ else
turn_off_rsys_logging turn_off_rsys_logging
fi 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 systemctl restart syslog
if [ -d /etc/tor ]; then if [ -d /etc/tor ]; then
if [[ "$2" != "--onion" ]]; then if [[ "$2" != "--onion" ]]; then
@ -260,12 +275,6 @@ fi
if [ -d /etc/prosody ]; then if [ -d /etc/prosody ]; then
systemctl restart prosody systemctl restart prosody
fi 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 if [ -d /etc/dovecot ]; then
systemctl restart dovecot systemctl restart dovecot
fi fi

View File

@ -72,17 +72,17 @@ $(get_ssh_server_key)
echo '' echo ''
echo $'Shutting down the system. Detatch the ethernet cable, attach wifi dongle, then power on again.' echo $'Shutting down the system. Detatch the ethernet cable, attach wifi dongle, then power on again.'
echo '' echo ''
${PROJECT_NAME}-logging off ${PROJECT_NAME}-logging off --restart
systemctl poweroff systemctl poweroff
return return
fi fi
echo $'Turning off logging' echo $'Turning off logging'
${PROJECT_NAME}-logging off ${PROJECT_NAME}-logging off --restart
echo $'Rebooting the system' echo $'Rebooting the system'
systemctl reboot -i systemctl reboot -i
fi fi
echo $'Turning off logging' echo $'Turning off logging'
${PROJECT_NAME}-logging off ${PROJECT_NAME}-logging off --restart
} }
function update_installed_apps_list { function update_installed_apps_list {