#!/usr/bin/env bash # Download the capstone log-sink source files to the Ubuntu origin. # Safe to re-run: Terraform state and local tfvars are not touched. set -euo pipefail BASE='https://zt-capstone.cloudflareacademy.com/logsink' DEST="$HOME/zt-capstone-logsink" mkdir -p "$DEST/worker" for file in \ deploy.sh install-terraform.sh pull-logs.sh \ main.tf outputs.tf variables.tf versions.tf \ schema.sql terraform.tfvars.example worker/zt-logsink.js; do curl -fsSL "$BASE/$file" -o "$DEST/$file" done chmod +x "$DEST/deploy.sh" "$DEST/install-terraform.sh" "$DEST/pull-logs.sh" printf 'Log-sink files downloaded to %s\n' "$DEST"