Created
May 10, 2026 20:42
-
-
Save koliadych/bb5f37e9008b0c4a537421c7fd7a311d to your computer and use it in GitHub Desktop.
fintechner dashboard log tail
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # fintechner — show recent dashboard logs and let you trigger a login attempt. | |
| set -euo pipefail | |
| REGION=ap-northeast-1 | |
| INSTANCE_ID=i-089ad4a6b76132ba2 | |
| echo "=== Last 100 lines of dashboard journal ===" | |
| CMD_ID=$(aws --region "$REGION" ssm send-command \ | |
| --instance-ids "$INSTANCE_ID" \ | |
| --document-name AWS-RunShellScript \ | |
| --parameters 'commands=[ | |
| "sudo journalctl -u fintechner-dashboard -n 100 --no-pager", | |
| "echo === connector status ===", | |
| "sudo systemctl is-active fintechner-connector || echo connector-not-running", | |
| "echo === ports listening ===", | |
| "sudo ss -tlnp | grep -E :(3000|8080) || echo no-ports" | |
| ]' \ | |
| --query Command.CommandId --output text) | |
| for i in $(seq 1 15); do | |
| sleep 3 | |
| 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) break ;; | |
| esac | |
| done | |
| 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