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