-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathinstall.sh
More file actions
59 lines (48 loc) · 1.13 KB
/
Copy pathinstall.sh
File metadata and controls
59 lines (48 loc) · 1.13 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
#!/bin/bash
set -e
REPO="hellotimking/clog"
INSTALL_DIR="/usr/local/bin"
BINARY="clog"
echo "Installing CLOG - High-Visibility Caddy Logs"
echo ""
# Detect OS and architecture
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
ARCH=$(uname -m)
case $OS in
linux|darwin) ;;
*)
echo "Unsupported OS: $OS"
exit 1
;;
esac
case $ARCH in
x86_64)
ASSET="clog-${OS}-amd64"
;;
aarch64|arm64)
ASSET="clog-${OS}-arm64"
;;
*)
echo "Unsupported architecture: $ARCH"
exit 1
;;
esac
echo "Detected: $OS/$ARCH"
echo "Downloading $ASSET..."
# Get latest release download URL
DOWNLOAD_URL=$(curl -s "https://api.github.com/repos/${REPO}/releases/latest" \
| grep "browser_download_url" \
| grep "$ASSET" \
| cut -d '"' -f 4)
if [ -z "$DOWNLOAD_URL" ]; then
echo "Error: Could not find download URL for $ASSET"
exit 1
fi
# Download binary
curl -L "$DOWNLOAD_URL" -o "/tmp/$BINARY"
# Install
chmod +x "/tmp/$BINARY"
sudo mv "/tmp/$BINARY" "$INSTALL_DIR/$BINARY"
echo ""
echo "CLOG installed successfully!"
echo "Run: clog /path/to/caddy/access.log"