Fix update script

Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
This commit is contained in:
Harsh Shandilya 2019-05-05 02:40:28 +05:30
parent 0c0361b8a8
commit 19a3eccdec
No known key found for this signature in database
GPG key ID: C2E74282C2133D62

View file

@ -19,7 +19,7 @@ done < <(find . -name '*.service' -print0 | sed 's/\.\///g')
# Place the systemd unit files where they belong
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
reportWarning "Reloading systemctl daemon"
@ -27,7 +27,8 @@ sudo systemctl daemon-reload
# Now loop through each service and restart it
for service in "${services[@]}"; do
service="${service/.service/}"
reportWarning "Restarting ${service}"
service "${service}" restart
[ -f "/etc/systemd/system/${service}.service" ] || systemctl enable "${service}"
done
sudo service "${service}" restart
[ -f "/etc/systemd/system/multi-user.target.wants/${service}.service" ] && sudo systemctl enable "${service}"
done