Repository navigation
Expand file tree
/
Copy pathstatus.sh.example
More file actions
36 lines (33 loc) · 1.7 KB
/
Copy pathstatus.sh.example
File metadata and controls
36 lines (33 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/env bash
# =============================================================================
# status.sh TEMPLATE
# Displays status of all 3 DRADIS containers with uptime and recent logs
#
# SETUP:
# 1. Copy this file and update HOST, USER, and KEY variables
# 2. Run: chmod +x status.sh.example && ./status.sh.example
# =============================================================================
# ⚙️ CUSTOMIZE THESE VALUES FOR YOUR SERVER
HOST="<YOUR_SERVER_IP>" # e.g., "192.168.1.100" or "example.com"
USER="<YOUR_USERNAME>" # e.g., "ubuntu", "root", "ec2-user"
KEY="<PATH_TO_SSH_KEY>" # e.g., "~/.ssh/id_rsa"
SSH_PORT="22" # SSH port (usually 22)
echo "📊 RUSTPOLYBOT STATUS (BTC | ETH | SOL)"
echo "───────────────────────────────────────────────────────────────"
ssh -p "$SSH_PORT" -i "$KEY" "$USER@$HOST" '
for c in btc eth sol; do
cont="dradis-$c"
if docker ps --format "{{.Names}}" | grep -q "^$cont$"; then
uptime=$(docker ps --format "{{.RunningFor}}" --filter "name=$cont" | cut -d" " -f1-3)
market=$(docker logs "$cont" --tail 150 2>/dev/null | grep "→ " | grep -E "Up or Down" | tail -1 | sed "s/.*→ //" | tr -d "\r")
echo "✅ $c → running | uptime: $uptime"
echo " Market: ${market:-(none selected yet)}"
echo " Last 3 logs:"
docker logs "$cont" --tail 3 2>/dev/null | sed "s/^/ /"
echo ""
else
echo "❌ $c → container not running"
echo ""
fi
done
'