mirror of
https://github.com/msfjarvis/server-config
synced 2025-08-15 08:37:01 +05:30
Fix update script
Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
This commit is contained in:
parent
0c0361b8a8
commit
19a3eccdec
1 changed files with 5 additions and 4 deletions
|
@ -19,7 +19,7 @@ done < <(find . -name '*.service' -print0 | sed 's/\.\///g')
|
||||||
|
|
||||||
# Place the systemd unit files where they belong
|
# Place the systemd unit files where they belong
|
||||||
reportWarning "Copying systemd files to /etc/systemd/system"
|
reportWarning "Copying systemd files to /etc/systemd/system"
|
||||||
for service in "${services[@]}"; do cp "${service}" /etc/systemd/system/; done
|
for service in "${services[@]}"; do sudo cp "${service}" /etc/systemd/system/; done
|
||||||
|
|
||||||
# Reload systemctl so that it processes our changes
|
# Reload systemctl so that it processes our changes
|
||||||
reportWarning "Reloading systemctl daemon"
|
reportWarning "Reloading systemctl daemon"
|
||||||
|
@ -27,7 +27,8 @@ sudo systemctl daemon-reload
|
||||||
|
|
||||||
# Now loop through each service and restart it
|
# Now loop through each service and restart it
|
||||||
for service in "${services[@]}"; do
|
for service in "${services[@]}"; do
|
||||||
|
service="${service/.service/}"
|
||||||
reportWarning "Restarting ${service}"
|
reportWarning "Restarting ${service}"
|
||||||
service "${service}" restart
|
sudo service "${service}" restart
|
||||||
[ -f "/etc/systemd/system/${service}.service" ] || systemctl enable "${service}"
|
[ -f "/etc/systemd/system/multi-user.target.wants/${service}.service" ] && sudo systemctl enable "${service}"
|
||||||
done
|
done
|
Loading…
Add table
Add a link
Reference in a new issue