mirror of
https://github.com/henrygd/beszel.git
synced 2026-01-15 14:50:32 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8d9e9260e6 | ||
|
|
0fc4a6daed |
@@ -12,6 +12,24 @@ is_freebsd() {
|
||||
[ "$(uname -s)" = "FreeBSD" ]
|
||||
}
|
||||
|
||||
is_glibc() {
|
||||
# Prefer glibc-enabled agent (NVML via purego) on linux/amd64 glibc systems.
|
||||
# Check common dynamic loader paths first (fast + reliable).
|
||||
for p in \
|
||||
/lib64/ld-linux-x86-64.so.2 \
|
||||
/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 \
|
||||
/lib/ld-linux-x86-64.so.2; do
|
||||
[ -e "$p" ] && return 0
|
||||
done
|
||||
|
||||
# Fallback to ldd output if available.
|
||||
if command -v ldd >/dev/null 2>&1; then
|
||||
ldd --version 2>&1 | grep -qiE 'gnu libc|glibc' && return 0
|
||||
fi
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
|
||||
# If SELinux is enabled, set the context of the binary
|
||||
set_selinux_context() {
|
||||
@@ -522,7 +540,7 @@ if is_alpine; then
|
||||
# Add the user to the docker group to allow access to the Docker socket if group docker exists
|
||||
if getent group docker; then
|
||||
echo "Adding beszel to docker group"
|
||||
usermod -aG docker beszel
|
||||
addgroup beszel docker
|
||||
fi
|
||||
|
||||
elif is_openwrt; then
|
||||
@@ -598,6 +616,9 @@ echo "Downloading and installing the agent..."
|
||||
OS=$(uname -s | sed -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/')
|
||||
ARCH=$(detect_architecture)
|
||||
FILE_NAME="beszel-agent_${OS}_${ARCH}.tar.gz"
|
||||
if [ "$OS" = "linux" ] && [ "$ARCH" = "amd64" ] && is_glibc; then
|
||||
FILE_NAME="beszel-agent_${OS}_${ARCH}_glibc.tar.gz"
|
||||
fi
|
||||
|
||||
# Determine version to install
|
||||
if [ "$VERSION" = "latest" ]; then
|
||||
|
||||
Reference in New Issue
Block a user