From 059927c38c652c5de60f11f497e14e541863c658 Mon Sep 17 00:00:00 2001 From: Matthew Saunders Brown Date: Tue, 18 Oct 2022 16:28:39 -0700 Subject: [PATCH] configure needrestart --- install.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index 83bb232..50a052c 100755 --- a/install.sh +++ b/install.sh @@ -32,8 +32,13 @@ fi apt-get update -# modify policy-rc.d so that packages automatically start/restart/stop after install/upgrade/uninstall -sed -i "s|exit 101|exit 0|g" /usr/sbin/policy-rc.d +# have packages automatically start/restart/stop after install/upgrade/uninstall +if [[ -f /usr/sbin/policy-rc.d ]]; then + sed -i "s|exit 101|exit 0|g" /usr/sbin/policy-rc.d +fi +if [[ -f /etc/needrestart/needrestart.conf ]]; then + sed -i "s|^#\$nrconf{restart} = 'i';|\$nrconf{restart} = 'a';|g" /etc/needrestart/needrestart.conf +fi # install pwgen, used to create random passwords DEBIAN_FRONTEND=noninteractive apt-get -y install pwgen