-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
28 lines (21 loc) · 780 Bytes
/
Copy pathinstall.sh
File metadata and controls
28 lines (21 loc) · 780 Bytes
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
#!/bin/bash
set -e
REPO="TheSpiritMan/Cloudflared-TCP"
TMP_DEB="/tmp/cloudflared-tcp_latest.deb"
echo "🔍 Checking dependencies..."
if ! command -v jq >/dev/null 2>&1; then
sudo apt update && sudo apt install jq -y
fi
echo "🌐 Fetching latest release URL..."
LATEST_URL=$(curl -s "https://api.github.com/repos/$REPO/releases/latest" \
| jq -r '.assets[] | select(.name | endswith(".deb")) | .browser_download_url')
if [ -z "$LATEST_URL" ]; then
echo "❌ Error: Could not find a .deb asset in the latest release of $REPO"
exit 1
fi
echo "⬇️ Downloading and installing package..."
curl -L "$LATEST_URL" -o "$TMP_DEB"
sudo apt install "$TMP_DEB" -f -y
# Cleanup the temporary .deb file
rm -f "$TMP_DEB"
echo "✅ cloudflared-tcp installation complete!"