From 33ff2d62885677808ac6698e2d25974f2af01612 Mon Sep 17 00:00:00 2001 From: Daniel Hansson Date: Fri, 24 Mar 2023 11:38:21 +0100 Subject: [PATCH] automatically restart services (#2459) Signed-off-by: Daniel Hansson --- nextcloud_update.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/nextcloud_update.sh b/nextcloud_update.sh index ef931cc2..f7325399 100644 --- a/nextcloud_update.sh +++ b/nextcloud_update.sh @@ -32,6 +32,16 @@ root_check is_process_running apt is_process_running dpkg +# Automatically restart services (Ubuntu 22.04) +if ! version 16.04.10 "$DISTRO" 20.04.10 +then + if ! grep -r "{restart} = 'a'" /etc/needrestart/needrestart.conf + then + # Restart mode: (l)ist only, (i)nteractive or (a)utomatically. + sed -i "s|#\$nrconf{restart} = .*|\$nrconf{restart} = 'a';|g" /etc/needrestart/needrestart.conf + fi +fi + # Check for pending-snapshot if does_snapshot_exist "NcVM-snapshot-pending" then