Add service and timer for androidx-release-watcher

Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
This commit is contained in:
Harsh Shandilya 2019-07-31 17:50:22 +05:30
parent 7ed50631f7
commit ac002ae0cf
No known key found for this signature in database
GPG key ID: C2E74282C2133D62
3 changed files with 40 additions and 2 deletions

View file

@ -8,7 +8,8 @@ function prettyPrint {
}
# Grab all service names
declare -a services=('caddy' 'gitea' 'horbiswalls-bot' 'mirror-bot' 'uno-bot')
declare -a services=('androidx-release-watcher' 'caddy' 'gitea' 'horbiswalls-bot' 'mirror-bot' 'uno-bot')
declare -a timers=('release-watcher-recent')
# Now loop through each service and install it
for service in "${services[@]}"; do
@ -19,9 +20,24 @@ for service in "${services[@]}"; do
sudo cp -v "${service}.service" /etc/systemd/system/
sudo systemctl daemon-reload
prettyPrint "Restarting ${service}"
sudo service "${service}" restart
sudo systemctl restart "${service}"
if [ ! -f "/etc/systemd/system/multi-user.target.wants/${service}.service" ]; then
prettyPrint "Enabling ${service}"
sudo systemctl enable "${service}"
fi
done
for timer in "${timers[@]}"; do
if [ "${1}" ] && [ "${timer}" != "${1}" ]; then
continue
fi
prettyPrint "Installing ${timer}"
sudo cp -v "${timer}.timer" /etc/systemd/system/
sudo systemctl daemon-reload
prettyPrint "Restarting ${timer}"
sudo systemctl restart "${timer}".timer
if [ ! -f "/etc/systemd/system/multi-user.target.wants/${timer}.timer" ]; then
prettyPrint "Enabling ${timer}"
sudo systemctl enable "${timer}".timer
fi
done