-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·81 lines (68 loc) · 2.35 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·81 lines (68 loc) · 2.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/usr/bin/env bash
set -euo pipefail
# AdClaw — AI Marketing Assistant
# Quick install: curl -sSL https://raw.githubusercontent.com/Citedy/adclaw/main/install.sh | bash
ADCLAW_IMAGE="nttylock/adclaw:latest"
ADCLAW_PORT="${ADCLAW_PORT:-8088}"
echo "============================================"
echo " AdClaw — AI Marketing Assistant Installer"
echo "============================================"
echo ""
# Check Docker
if ! command -v docker &>/dev/null; then
echo "Docker is not installed. Installing Docker..."
curl -fsSL https://get.docker.com | sh
echo "Docker installed."
fi
# Check Docker running
if ! docker info &>/dev/null; then
echo "ERROR: Docker daemon is not running. Please start Docker and retry."
exit 1
fi
# Prompt for Citedy API key
echo ""
echo "Get your free Citedy API key at: https://www.citedy.com/developer"
read -rp "Citedy API key (or press Enter to skip): " CITEDY_API_KEY
# Prompt for Telegram bot token
echo ""
echo "Create a Telegram bot via @BotFather to chat with AdClaw from your phone."
read -rp "Telegram bot token (or press Enter to skip): " TELEGRAM_BOT_TOKEN
# Stop existing container if present
if docker ps -a --format '{{.Names}}' | grep -q '^adclaw$'; then
echo ""
echo "Stopping existing AdClaw container..."
docker stop adclaw && docker rm adclaw || true
fi
# Pull latest image
echo ""
echo "Pulling $ADCLAW_IMAGE ..."
docker pull "$ADCLAW_IMAGE"
# Build run command
RUN_ARGS=(
-d
--name adclaw
--restart unless-stopped
-p "${ADCLAW_PORT}:8088"
-v adclaw-data:/app/working
-e "ADCLAW_ENABLED_CHANNELS=discord,dingtalk,feishu,qq,console,telegram"
-e "LOG_LEVEL=INFO"
)
[ -n "${CITEDY_API_KEY:-}" ] && RUN_ARGS+=(-e "CITEDY_API_KEY=$CITEDY_API_KEY")
[ -n "${TELEGRAM_BOT_TOKEN:-}" ] && RUN_ARGS+=(-e "TELEGRAM_BOT_TOKEN=$TELEGRAM_BOT_TOKEN")
echo ""
echo "Starting AdClaw..."
docker run "${RUN_ARGS[@]}" "$ADCLAW_IMAGE"
echo ""
echo "============================================"
echo " AdClaw is running!"
echo ""
echo " Web UI: http://localhost:${ADCLAW_PORT}"
if [ -n "${TELEGRAM_BOT_TOKEN:-}" ]; then
echo " Telegram: Bot is active"
fi
echo ""
echo " Manage: docker logs -f adclaw"
echo " Stop: docker stop adclaw"
echo " Update: docker pull $ADCLAW_IMAGE && docker stop adclaw && docker rm adclaw"
echo " Then re-run this script."
echo "============================================"