From 9077b4dbb9af1835c81500dd801fbde4dec857d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C4=83rcziem=20=E2=84=A2?= <118485377+spalencsar@users.noreply.github.com> Date: Mon, 6 Oct 2025 10:30:15 +0200 Subject: [PATCH] Fix get_system_info for cross-distribution compatibility - Remove dependency on lsb_release (not available on all distros) - Use DISTRO_NAME variable for OS info - Fix uptime parsing to work without -p option --- lib/common.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/common.sh b/lib/common.sh index f0f746e..1f0f8a1 100644 --- a/lib/common.sh +++ b/lib/common.sh @@ -412,12 +412,12 @@ cleanup() { # Performance monitoring get_system_info() { log_info "System Information:" - echo " OS: $(lsb_release -d | cut -f2)" + echo " OS: ${DISTRO_NAME:-Unknown}" echo " Kernel: $(uname -r)" echo " CPU: $(lscpu | grep 'Model name' | cut -d: -f2 | xargs)" echo " RAM: $(free -h | awk 'NR==2{printf "%s/%s", $3,$2}')" echo " Disk: $(df -h / | awk 'NR==2{printf "%s/%s (%s used)", $3,$2,$5}')" - echo " Uptime: $(uptime -p)" + echo " Uptime: $(uptime | awk -F'up ' '{print $2}' | awk -F',' '{print $1,$2}' | xargs)" } # Version and compatibility checks