Skip to content

Instantly share code, notes, and snippets.

@koliadych
Created May 10, 2026 21:16
Show Gist options
  • Select an option

  • Save koliadych/3724bb2fa955cee8969fe4d735df2f61 to your computer and use it in GitHub Desktop.

Select an option

Save koliadych/3724bb2fa955cee8969fe4d735df2f61 to your computer and use it in GitHub Desktop.
fintechner verify
#!/bin/bash
set -euo pipefail
export AWS_PAGER=""
REGION=ap-northeast-1
INSTANCE_ID=i-089ad4a6b76132ba2
CMD_ID=$(aws --region "$REGION" ssm send-command \
--instance-ids "$INSTANCE_ID" \
--document-name AWS-RunShellScript \
--parameters '{"commands":[
"echo --- services ---",
"for s in caddy fintechner-connector fintechner-dashboard; do printf \"%-25s %s\\n\" \"$s\" \"$(sudo systemctl is-active $s)\"; done",
"sudo docker ps --format \"timescale {{.Status}}\"",
"echo",
"echo --- ports listening ---",
"sudo ss -tlnp | grep -E \"\\b(80|443|3000|8080)\\b\"",
"echo",
"echo --- connector journal (last 30, expect NO reload-loop spam) ---",
"sudo journalctl -u fintechner-connector -n 30 --no-pager",
"echo",
"echo --- caddy proxy timeouts ---",
"sudo grep -A1 transport /etc/caddy/Caddyfile"
]}' \
--query Command.CommandId --output text)
for i in $(seq 1 20); do
sleep 4
STATUS=$(aws --region "$REGION" ssm get-command-invocation --command-id "$CMD_ID" --instance-id "$INSTANCE_ID" --query Status --output text 2>/dev/null || echo Pending)
case "$STATUS" in Success|Failed|Cancelled|TimedOut) echo " $STATUS"; break ;; *) echo " $STATUS";; esac
done
echo
aws --region "$REGION" ssm get-command-invocation --command-id "$CMD_ID" --instance-id "$INSTANCE_ID" --query StandardOutputContent --output text
echo
echo "--- STDERR ---"
aws --region "$REGION" ssm get-command-invocation --command-id "$CMD_ID" --instance-id "$INSTANCE_ID" --query StandardErrorContent --output text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment