-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap.sh
More file actions
79 lines (69 loc) · 2.39 KB
/
bootstrap.sh
File metadata and controls
79 lines (69 loc) · 2.39 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
#!/data/data/com.termux/files/usr/bin/bash
# ============================================================
# OpenClaw Pocket Server — Bootstrap Installer
# One-liner: curl -sL <RAW_URL>/bootstrap.sh | bash
# ============================================================
set -euo pipefail
REPO="Muxd21/openpocket"
BRANCH="main"
BASE="https://raw.githubusercontent.com/${REPO}/${BRANCH}"
RED='\033[0;31m'
GREEN='\033[0;32m'
CYAN='\033[0;36m'
YELLOW='\033[1;33m'
MAGENTA='\033[0;35m'
BOLD='\033[1m'
NC='\033[0m'
echo ""
echo -e "${MAGENTA}${BOLD}"
echo " ┌───────────────────────────────────────────────────┐"
echo " │ 🛰️ OPENPOCKET AI SERVER BOOTSTRAP │"
echo " │ Native. Professional. 24/7 Agent. │"
echo " └───────────────────────────────────────────────────┘"
echo -e "${NC}"
echo -e " ${CYAN}By ${BOLD}Muxd21${NC}"
echo -e " ${YELLOW}github.com/Muxd21/openpocket${NC}"
echo ""
# --- Verify Termux ---
if [ -z "${PREFIX:-}" ] || [[ "$PREFIX" != */com.termux/* ]]; then
echo -e "${RED}[ERROR] This script must be run inside Termux.${NC}"
echo " Install Termux from F-Droid: https://f-droid.org/en/packages/com.termux/"
exit 1
fi
# --- Download all files ---
INSTALL_DIR="$HOME/openpocket"
mkdir -p "$INSTALL_DIR"/{scripts,patches,tests,docs}
FILES=(
"install.sh"
"scripts/check-env.sh"
"scripts/install-deps.sh"
"scripts/setup-env.sh"
"scripts/setup-ssh.sh"
"scripts/setup-tmux.sh"
"scripts/setup-boot.sh"
"patches/termux-compat.h"
"patches/bionic-compat.js"
"patches/spawn.h"
"patches/patch-paths.sh"
"patches/apply-patches.sh"
"patches/systemctl"
"tests/verify-install.sh"
)
echo -e "${CYAN}[INFO]${NC} Downloading files..."
FAIL=0
for f in "${FILES[@]}"; do
if curl -sfL "${BASE}/${f}" -o "${INSTALL_DIR}/${f}"; then
chmod +x "${INSTALL_DIR}/${f}" 2>/dev/null || true
else
echo -e "${RED}[FAIL]${NC} Failed to download: ${f}"
FAIL=1
fi
done
if [ "$FAIL" -eq 1 ]; then
echo -e "${RED}[ERROR] Some files failed to download. Check your internet connection.${NC}"
exit 1
fi
echo -e "${GREEN}[OK]${NC} All files downloaded to ${INSTALL_DIR}"
# --- Run installer ---
echo ""
exec bash "${INSTALL_DIR}/install.sh"