systemd_units: Allow skipping service restarts

Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
This commit is contained in:
Harsh Shandilya 2019-08-17 12:13:49 +05:30
parent ed9df8eac5
commit 03ec32c1ea
No known key found for this signature in database
GPG key ID: C2E74282C2133D62

View file

@ -18,10 +18,12 @@ for service in "${services[@]}"; do
prettyPrint "Installing ${service}"
sudo cp -v "${service}.service" /etc/systemd/system/
sudo systemctl daemon-reload
prettyPrint "Restarting ${service}"
sudo systemctl restart "${service}"
if [ ! -f "/etc/systemd/system/multi-user.target.wants/${service}.service" ]; then
prettyPrint "Enabling ${service}"
sudo systemctl enable "${service}"
if [ "${NO_RESTART}" = false ]; then
prettyPrint "Restarting ${service}"
sudo systemctl restart "${service}"
if [ ! -f "/etc/systemd/system/multi-user.target.wants/${service}.service" ]; then
prettyPrint "Enabling ${service}"
sudo systemctl enable "${service}"
fi
fi
done