File size: 702 Bytes
5116a2e
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/bash
# Monitor Hugging Face Space IP changes
CURRENT_IP=$(ping -c 1 nexusbert-scalperbot.hf.space 2>/dev/null | grep -oE '([0-9]{1,3}\.){3}[0-9]{1,3}' | head -1)
STORED_IP=$(cat ~/.hf_space_ip 2>/dev/null || echo 'unknown')

if [ "$CURRENT_IP" != "$STORED_IP" ]; then
    echo "🚨 IP CHANGED: $STORED_IP$CURRENT_IP"
    echo "📝 Update Bybit API whitelist with: $CURRENT_IP"
    echo "$CURRENT_IP" > ~/.hf_space_ip
    # Send notification if telegram is configured
    # curl -s "https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/sendMessage" -d "chat_id=$TELEGRAM_CHAT_ID" -d "text=🚨 HF Space IP Changed: $CURRENT_IP" 2>/dev/null || true
else
    echo "✅ IP stable: $CURRENT_IP"
fi