mirror of
https://github.com/henrygd/beszel.git
synced 2026-04-09 14:31:50 +02:00
Compare commits
3 Commits
v0.18.2
...
acaa9381fe
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
acaa9381fe | ||
|
|
8d9e9260e6 | ||
|
|
0fc4a6daed |
@@ -435,7 +435,7 @@ func (sm *SmartManager) CollectSmart(deviceInfo *DeviceInfo) error {
|
|||||||
defer cancel()
|
defer cancel()
|
||||||
|
|
||||||
// Try with -n standby first if we have existing data
|
// Try with -n standby first if we have existing data
|
||||||
args := sm.smartctlArgs(deviceInfo, true)
|
args := sm.smartctlArgs(deviceInfo, hasExistingData)
|
||||||
cmd := exec.CommandContext(ctx, sm.binPath, args...)
|
cmd := exec.CommandContext(ctx, sm.binPath, args...)
|
||||||
output, err := cmd.CombinedOutput()
|
output, err := cmd.CombinedOutput()
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,24 @@ is_freebsd() {
|
|||||||
[ "$(uname -s)" = "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
|
# If SELinux is enabled, set the context of the binary
|
||||||
set_selinux_context() {
|
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
|
# Add the user to the docker group to allow access to the Docker socket if group docker exists
|
||||||
if getent group docker; then
|
if getent group docker; then
|
||||||
echo "Adding beszel to docker group"
|
echo "Adding beszel to docker group"
|
||||||
usermod -aG docker beszel
|
addgroup beszel docker
|
||||||
fi
|
fi
|
||||||
|
|
||||||
elif is_openwrt; then
|
elif is_openwrt; then
|
||||||
@@ -598,6 +616,9 @@ echo "Downloading and installing the agent..."
|
|||||||
OS=$(uname -s | sed -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/')
|
OS=$(uname -s | sed -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/')
|
||||||
ARCH=$(detect_architecture)
|
ARCH=$(detect_architecture)
|
||||||
FILE_NAME="beszel-agent_${OS}_${ARCH}.tar.gz"
|
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
|
# Determine version to install
|
||||||
if [ "$VERSION" = "latest" ]; then
|
if [ "$VERSION" = "latest" ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user