install needrestart if not existing (#2543)

Signed-off-by: Daniel Hansson <mailto@danielhansson.nu>
This commit is contained in:
Daniel Hansson 2023-08-11 16:54:22 +02:00 committed by GitHub
parent 8bab391237
commit cbfdd7b84b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -35,6 +35,10 @@ is_process_running dpkg
# Automatically restart services (Ubuntu 22.04)
if ! version 16.04.10 "$DISTRO" 20.04.10
then
if [ ! -f /etc/needrestart/needrestart.conf ]
then
install_if_not needrestart
fi
if ! grep -rq "{restart} = 'a'" /etc/needrestart/needrestart.conf
then
# Restart mode: (l)ist only, (i)nteractive or (a)utomatically.