scalperBot / monitor_ip.sh
nexusbert's picture
Upload 47 files
5116a2e verified
#!/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