From 03ec32c1ea9c68d456352f3a8c6b0288992ed18e Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Sat, 17 Aug 2019 12:13:49 +0530 Subject: [PATCH] systemd_units: Allow skipping service restarts Signed-off-by: Harsh Shandilya --- systemd_units/update.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/systemd_units/update.sh b/systemd_units/update.sh index 1f50fbe..3c10872 100755 --- a/systemd_units/update.sh +++ b/systemd_units/update.sh @@ -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