Allow updating singular units

Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
This commit is contained in:
Harsh Shandilya 2019-07-18 08:21:38 +00:00
parent 3a6e204a00
commit e8acfeae93
No known key found for this signature in database
GPG key ID: C2E74282C2133D62

View file

@ -10,16 +10,14 @@ function prettyPrint {
# Grab all service names
declare -a services=('caddy' 'horbiswalls-bot' 'mirror-bot' 'uno-bot')
# Place the systemd unit files where they belong
prettyPrint "Copying systemd files to /etc/systemd/system"
for service in "${services[@]}"; do sudo cp -v "${service}.service" /etc/systemd/system/; done
# Reload systemctl so that it processes our changes
prettyPrint "Reloading systemctl daemon"
sudo systemctl daemon-reload
# Now loop through each service and restart it
# Now loop through each service and install it
for service in "${services[@]}"; do
if [ "${1}" ] && [ "${service}" != "${1}" ]; then
continue
fi
prettyPrint "Installing ${service}"
sudo cp -v "${service}.service" /etc/systemd/system/
sudo systemctl daemon-reload
prettyPrint "Restarting ${service}"
sudo service "${service}" restart
if [ ! -f "/etc/systemd/system/multi-user.target.wants/${service}.service" ]; then