Download scripts/install/cloudflared-install.sh from hftestx/67b8b004: direct link, hf CLI and curl.
- Browser
- Download file 1.36 kB
-
https://huggingface.co/spaces/hftestx/67b8b004/resolve/main/scripts/install/cloudflared-install.sh
- Command line
-
hf download hf://spaces/hftestx/67b8b004/scripts/install/cloudflared-install.sh
-
curl -L -o cloudflared-install.sh https://huggingface.co/spaces/hftestx/67b8b004/resolve/main/scripts/install/cloudflared-install.sh
1.36 kB
| set -e | |
| # Function for logging | |
| log() { | |
| echo "[$(date '+%Y-%m-%d %H:%M:%S')] $*" | |
| } | |
| # Function for cleanup | |
| cleanup() { | |
| log "Performing cloudflared installation cleanup..." | |
| apt-get clean | |
| rm -rf \ | |
| /tmp/cloudflared* \ | |
| /var/lib/apt/lists/* \ | |
| /var/tmp/* | |
| } | |
| # Trap to ensure cleanup on exit | |
| trap cleanup EXIT | |
| log "Starting cloudflared installation..." | |
| log "Creating keyrings directory..." | |
| mkdir -p --mode=0755 /usr/share/keyrings | |
| log "Adding Cloudflare repository key..." | |
| curl -fsSL https://pkg.cloudflare.com/cloudflare-main.gpg | \ | |
| tee /usr/share/keyrings/cloudflare-main.gpg >/dev/null | |
| log "Adding Cloudflare repository..." | |
| echo 'deb [signed-by=/usr/share/keyrings/cloudflare-main.gpg] https://pkg.cloudflare.com/cloudflared any main' | \ | |
| tee /etc/apt/sources.list.d/cloudflared.list | |
| log "Updating package lists..." | |
| apt-get update | |
| log "Installing cloudflared..." | |
| apt-get install -y --no-install-recommends cloudflared | |
| log "Verifying cloudflared installation..." | |
| if command -v cloudflared >/dev/null 2>&1; then | |
| CLOUDFLARED_VERSION=$(cloudflared --version 2>&1 | head -n1 || echo "Version check failed") | |
| log "cloudflared installed successfully: ${CLOUDFLARED_VERSION}" | |
| else | |
| log "ERROR: cloudflared installation failed" | |
| exit 1 | |
| fi | |
| log "cloudflared installation completed successfully" | |