mirror of
https://github.com/msfjarvis/server-config
synced 2025-08-14 11:47:01 +05:30
systemd_units: Allow skipping service restarts
Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
This commit is contained in:
parent
ed9df8eac5
commit
03ec32c1ea
1 changed files with 7 additions and 5 deletions
|
@ -18,10 +18,12 @@ for service in "${services[@]}"; do
|
||||||
prettyPrint "Installing ${service}"
|
prettyPrint "Installing ${service}"
|
||||||
sudo cp -v "${service}.service" /etc/systemd/system/
|
sudo cp -v "${service}.service" /etc/systemd/system/
|
||||||
sudo systemctl daemon-reload
|
sudo systemctl daemon-reload
|
||||||
prettyPrint "Restarting ${service}"
|
if [ "${NO_RESTART}" = false ]; then
|
||||||
sudo systemctl restart "${service}"
|
prettyPrint "Restarting ${service}"
|
||||||
if [ ! -f "/etc/systemd/system/multi-user.target.wants/${service}.service" ]; then
|
sudo systemctl restart "${service}"
|
||||||
prettyPrint "Enabling ${service}"
|
if [ ! -f "/etc/systemd/system/multi-user.target.wants/${service}.service" ]; then
|
||||||
sudo systemctl enable "${service}"
|
prettyPrint "Enabling ${service}"
|
||||||
|
sudo systemctl enable "${service}"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue