Skip to content

Commit 33ff2d6

Browse files
authored
automatically restart services (#2459)
Signed-off-by: Daniel Hansson <[email protected]>
1 parent c670142 commit 33ff2d6

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

nextcloud_update.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,16 @@ root_check
3232
is_process_running apt
3333
is_process_running dpkg
3434

35+
# Automatically restart services (Ubuntu 22.04)
36+
if ! version 16.04.10 "$DISTRO" 20.04.10
37+
then
38+
if ! grep -r "{restart} = 'a'" /etc/needrestart/needrestart.conf
39+
then
40+
# Restart mode: (l)ist only, (i)nteractive or (a)utomatically.
41+
sed -i "s|#\$nrconf{restart} = .*|\$nrconf{restart} = 'a';|g" /etc/needrestart/needrestart.conf
42+
fi
43+
fi
44+
3545
# Check for pending-snapshot
3646
if does_snapshot_exist "NcVM-snapshot-pending"
3747
then

0 commit comments

Comments
 (0)