mirror of
https://github.com/msfjarvis/server-config
synced 2025-08-15 01:37:01 +05:30
Add service and timer for androidx-release-watcher
Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
This commit is contained in:
parent
7ed50631f7
commit
ac002ae0cf
3 changed files with 40 additions and 2 deletions
10
androidx-release-watcher.service
Normal file
10
androidx-release-watcher.service
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
[Unit]
|
||||||
|
Description=Telegram notifier service for androidx-release-watcher
|
||||||
|
Wants=release-watcher-recent.timer
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
WorkingDirectory=/home/bot/androidx-release-watcher
|
||||||
|
ExecStart=/home/bot/androidx-release-watcher/venv/bin/python telegram_notifier.py
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
12
release-watcher-recent.timer
Normal file
12
release-watcher-recent.timer
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
[Unit]
|
||||||
|
Description=Run shopify-recent every 24 hours with a 30 minute leeway
|
||||||
|
Requires=androidx-release-watcher.service
|
||||||
|
|
||||||
|
[Timer]
|
||||||
|
Unit=androidx-release-watcher.service
|
||||||
|
OnUnitInactiveSec=24h
|
||||||
|
RandomizedDelaySec=15m
|
||||||
|
AccuracySec=1s
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=timers.target
|
20
update.sh
20
update.sh
|
@ -8,7 +8,8 @@ function prettyPrint {
|
||||||
}
|
}
|
||||||
|
|
||||||
# Grab all service names
|
# 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
|
# Now loop through each service and install it
|
||||||
for service in "${services[@]}"; do
|
for service in "${services[@]}"; do
|
||||||
|
@ -19,9 +20,24 @@ for service in "${services[@]}"; do
|
||||||
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}"
|
prettyPrint "Restarting ${service}"
|
||||||
sudo service "${service}" restart
|
sudo systemctl restart "${service}"
|
||||||
if [ ! -f "/etc/systemd/system/multi-user.target.wants/${service}.service" ]; then
|
if [ ! -f "/etc/systemd/system/multi-user.target.wants/${service}.service" ]; then
|
||||||
prettyPrint "Enabling ${service}"
|
prettyPrint "Enabling ${service}"
|
||||||
sudo systemctl enable "${service}"
|
sudo systemctl enable "${service}"
|
||||||
fi
|
fi
|
||||||
done
|
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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue