#!/bin/bash
echo "=== TAILSCALE FUNNEL ==="
tailscale funnel status 2>&1
echo ""
echo "=== ORDINI 16/08 ==="
grep "16-08-16" /opt/charter-live/live_deploy_v2/logs/webhook_receiver.log 2>&1 | grep -E "ACCEPTED|REJECT|ORDER|ERROR|ANTI-DOPPIA|close_intent" | tail -30
echo ""
echo "=== POSIZIONI BYBIT 2° ACCOUNT ==="
cd /opt/charter-live/live_deploy_v2
/opt/charter/venv/bin/python -c "
from bybit_demo_client import BybitDemoClient
c = BybitDemoClient()
r = c._request('GET', '/v5/position/list', {'category':'linear','settleCoin':'USDT'}, signed=True)
lst = r.get('result', {}).get('list', [])
for p in lst:
    if float(p['size']) > 0:
        print(f\"{p['symbol']:14s} side={p['side']:4s} size={p['size']} entry={p['avgPrice']} mark={p['markPrice']} PnL={p['unrealisedPnl']}\")
" 2>&1
echo ""
echo "=== TAILSCALE DROP LOG ==="
journalctl -u tailscaled --no-pager -n 30 2>&1 | grep -E "Drop|Funnel" | tail -15
echo "---END---"
