ai-telegram-bot / quick-deploy.sh
abbasyk60's picture
Quick deploy script
e35348d verified
Raw
History Blame Contribute Delete
1.76 kB
#!/bin/bash
# OpenClaw Quick Deploy - No prompts, edit .env first!
# 1. Edit .env with your keys
# 2. Run: bash quick-deploy.sh
set -e
echo "OpenClaw Quick Deploy..."
# Install Docker if needed
if ! command -v docker &> /dev/null; then
echo "Installing Docker..."
curl -fsSL https://get.docker.com | sh
systemctl enable docker
systemctl start docker
fi
# Install docker-compose if needed
if ! command -v docker-compose &> /dev/null; then
echo "Installing docker-compose..."
apt-get update -qq
apt-get install -y -qq docker-compose > /dev/null 2>&1
fi
# Clone or pull
BOT_DIR="/opt/openclaw"
if [ -d "$BOT_DIR" ]; then
cd $BOT_DIR
git pull
else
git clone https://huggingface.co/spaces/abbasyk60/ai-telegram-bot $BOT_DIR
cd $BOT_DIR
fi
# Create .env if not exists
if [ ! -f .env ]; then
cat > .env << 'EOF'
# OpenClaw Configuration
# Edit these values with your API keys!
OPENROUTER_API_KEY=your_openrouter_key_here
TELEGRAM_BOT_TOKEN=your_telegram_bot_token_here
CLOUDFLARE_PROXY_URL=https://tg-proxy.zartaj.xyz
BASE_URL=http://localhost:7860
EOF
echo ""
echo "IMPORTANT: Edit .env file with your API keys!"
echo " nano /opt/openclaw/.env"
echo ""
echo "Then run this script again."
exit 1
fi
# Build and start
echo "Building..."
docker-compose build
echo "Starting..."
docker-compose up -d
echo ""
echo "============================================"
echo " OpenClaw Bot is RUNNING!"
echo "============================================"
echo ""
echo " Status: curl http://localhost:7860"
echo " Logs: docker-compose logs -f"
echo " Stop: docker-compose down"
echo " Restart: docker-compose restart"
echo ""
echo "============================================"