Download start.sh from proti0070/Vps3: direct link, hf CLI and curl.
- Browser
- Download file 1.04 kB
-
https://huggingface.co/spaces/proti0070/Vps3/resolve/main/start.sh
- Command line
-
hf download hf://spaces/proti0070/Vps3/start.sh
-
curl -L -o start.sh https://huggingface.co/spaces/proti0070/Vps3/resolve/main/start.sh
1.04 kB
| mkdir -p /run/dbus | |
| dbus-daemon --system --fork 2>/dev/null || true | |
| export PATH=$PATH:/usr/local/bin | |
| # OpenClaw config | |
| mkdir -p ~/.config/openclaw | |
| cat > ~/.config/openclaw/config.json << 'EOF' | |
| { | |
| "gateway": { | |
| "mode": "local", | |
| "port": 9000, | |
| "bind": "lan" | |
| } | |
| } | |
| EOF | |
| echo "=== Starting OpenClaw Gateway (background) ===" | |
| while true; do | |
| openclaw gateway --port 9000 --bind lan --allow-unconfigured | |
| sleep 10 | |
| done & | |
| sleep 5 | |
| echo "=== Starting ttyd terminal ===" | |
| ttyd \ | |
| --port 8080 \ | |
| --interface 127.0.0.1 \ | |
| --writable \ | |
| bash & | |
| TTYD_PID=$! | |
| sleep 3 | |
| echo "=== Starting nginx ===" | |
| nginx -g "daemon off;" & | |
| NGINX_PID=$! | |
| echo " | |
| ✅ Terminal: your-space.hf.space/ | |
| 🤖 OpenClaw: port 9000 (background) | |
| " | |
| # Keep alive | |
| while true; do | |
| if ! kill -0 $TTYD_PID 2>/dev/null; then | |
| ttyd --port 8080 --interface 127.0.0.1 --writable bash & | |
| TTYD_PID=$! | |
| fi | |
| if ! kill -0 $NGINX_PID 2>/dev/null; then | |
| nginx -g "daemon off;" & | |
| NGINX_PID=$! | |
| fi | |
| sleep 10 | |
| done |