All checks were successful
Deploy production / deploy (push) Successful in 1m15s
21 lines
925 B
Bash
21 lines
925 B
Bash
#!/usr/bin/env bash
|
|
# Install the /stats collector on the host as systemd user units (run as stan on stan-ovh):
|
|
# the runner script, the stats-collector@.service template and one timer per source.
|
|
# bash deploy/stats-collector/install.sh install + enable every timer
|
|
# bash deploy/stats-collector/install.sh --no-enable install only
|
|
set -euo pipefail
|
|
here="$(cd "$(dirname "$0")" && pwd)"
|
|
units="$HOME/.config/systemd/user"
|
|
install -D -m 755 "$here/stats-collector-run.sh" "$HOME/.local/bin/stats-collector-run.sh"
|
|
install -D -m 644 "$here/stats-collector@.service" "$units/stats-collector@.service"
|
|
timers=()
|
|
for timer in "$here"/stats-*.timer; do
|
|
install -m 644 "$timer" "$units/$(basename "$timer")"
|
|
timers+=("$(basename "$timer")")
|
|
done
|
|
systemctl --user daemon-reload
|
|
if [ "${1:-}" != --no-enable ]; then
|
|
systemctl --user enable --now "${timers[@]}"
|
|
fi
|
|
systemctl --user list-timers --no-pager 'stats-*'
|