2021-10-22 15:22:10 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2022-01-28 06:52:26 +00:00
|
|
|
# SPDX-FileCopyrightText: 2021-2022 Citadel and contributors
|
2021-10-22 15:22:10 +00:00
|
|
|
#
|
2022-01-21 20:37:48 +00:00
|
|
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
2021-10-22 15:22:10 +00:00
|
|
|
|
|
|
|
CITADEL_ROOT="$(readlink -f $(dirname "${BASH_SOURCE[0]}")/..)"
|
|
|
|
|
|
|
|
resource="${1}"
|
2021-11-07 08:10:31 +00:00
|
|
|
interval="${2}"
|
2021-10-22 15:22:10 +00:00
|
|
|
|
|
|
|
status_script="${CITADEL_ROOT}/scripts/status/${resource}"
|
|
|
|
output_path="${CITADEL_ROOT}/statuses/${resource}-status.json"
|
|
|
|
|
|
|
|
# Every $interval seconds, run the status script and write the output to the $output_path.
|
|
|
|
while true; do
|
|
|
|
"${status_script}" > "${output_path}"
|
|
|
|
sleep "${interval}"
|
|
|
|
done
|