39 lines
925 B
Bash
Executable File
39 lines
925 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
# shellcheck source=scripts/common.sh
|
|
source "$SCRIPT_DIR/scripts/common.sh"
|
|
|
|
QUICK=0
|
|
while [[ $# -gt 0 ]]; do
|
|
case "$1" in
|
|
--quick)
|
|
QUICK=1
|
|
shift
|
|
;;
|
|
-h|--help)
|
|
echo "Usage: ./self-check.sh [--quick]"
|
|
exit 0
|
|
;;
|
|
*)
|
|
die "unknown option: $1"
|
|
;;
|
|
esac
|
|
done
|
|
|
|
load_env
|
|
require_cmd docker
|
|
require_cmd jq
|
|
docker compose version >/dev/null
|
|
[[ -f "$COMPOSE_FILE" ]] || die "missing compose file"
|
|
[[ -f "$ENV_FILE" ]] || die "missing .env"
|
|
create_data_dirs
|
|
[[ -w "$HOST_DATA_DIR" ]] || die "data dir is not writable: $HOST_DATA_DIR"
|
|
compose_cmd --profile core --profile sidecar --profile monitor config >/dev/null
|
|
verify_image_platform "$RPKI_IMAGE" "$RPKI_PLATFORM" "runtime"
|
|
verify_monitor_images
|
|
if [[ "$QUICK" == "0" ]]; then
|
|
verify_runtime_image
|
|
fi
|
|
log "self-check ok"
|