mirror of
https://github.com/burrow-dev/burrow-server.git
synced 2026-11-18 17:27:50 -05:00
Add OpenRC service and configuration files to support automated server updates on systems without systemd timers. - Add `deploy/update-loop.sh` to handle periodic updates for OpenRC. - Add `deploy/burrow-update.openrc` and `deploy/burrow-update.conf`. - Update `deploy/update.sh` to support both systemd and OpenRC service restarts. - Add `deploy/README.md` with installation instructions. - Update `.gitignore` to allow the deployment documentation.
25 lines
645 B
Bash
25 lines
645 B
Bash
#!/usr/bin/env bash
|
|
# Runs update.sh repeatedly for init systems without a timer facility.
|
|
set -u
|
|
|
|
interval=${BURROW_UPDATE_INTERVAL:-120}
|
|
case "$interval" in
|
|
''|*[!0-9]*)
|
|
echo "BURROW_UPDATE_INTERVAL must be a positive number of seconds" >&2
|
|
exit 2
|
|
;;
|
|
esac
|
|
|
|
if [ "$interval" -eq 0 ]; then
|
|
echo "BURROW_UPDATE_INTERVAL must be greater than zero" >&2
|
|
exit 2
|
|
fi
|
|
|
|
script_dir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
|
|
|
|
while :; do
|
|
# A failed fetch or rejected update should not stop future update attempts.
|
|
"$script_dir/update.sh" || echo "burrow update failed; will retry in $interval seconds" >&2
|
|
sleep "$interval"
|
|
done
|