diff --git a/app/gather_info.sh b/app/gather_info.sh index 13946b2..486e008 100755 --- a/app/gather_info.sh +++ b/app/gather_info.sh @@ -22,6 +22,10 @@ if [ -f /etc/pve/.version ] || command -v pveversion &>/dev/null || [ -d /etc/pv pve_ver=$(pveversion 2>/dev/null | sed 's|pve-manager/||;s| .*||') echo "platform=proxmox" echo "platform_version=${pve_ver:-unknown}" +elif [ -f /etc/unraid-version ]; then + unraid_ver=$(grep 'version=' /etc/unraid-version 2>/dev/null | cut -d'"' -f2) + echo "platform=unraid" + echo "platform_version=${unraid_ver:-unknown}" fi # Motherboard (readable without root on most systems) @@ -34,8 +38,8 @@ echo "bios_date=$(cat /sys/class/dmi/id/bios_date 2>/dev/null || echo 'Unknown') echo "[cpu]" echo "model=$(lscpu 2>/dev/null | grep 'Model name' | sed 's/Model name:[[:space:]]*//')" echo "cores=$(nproc 2>/dev/null || echo 0)" -echo "sockets=$(lscpu 2>/dev/null | grep 'Socket(s)' | awk '{print $2}')" -echo "threads_per_core=$(lscpu 2>/dev/null | grep 'Thread(s) per core' | awk '{print $2}')" +echo "sockets=$(lscpu 2>/dev/null | grep 'Socket(s)' | awk -F: '{gsub(/^ +/,"",$2); print $2}')" +echo "threads_per_core=$(lscpu 2>/dev/null | grep 'Thread(s) per core' | awk -F: '{gsub(/^ +/,"",$2); print $2}')" # CPU usage - sample /proc/stat with 1 second interval read -r label user1 nice1 system1 idle1 iowait1 irq1 softirq1 steal1 _ < /proc/stat diff --git a/setup-remote.sh b/setup-remote.sh index 33575c5..57b4e32 100755 --- a/setup-remote.sh +++ b/setup-remote.sh @@ -33,6 +33,7 @@ detect_os() { debian|ubuntu|raspbian) echo "debian" ;; alpine) echo "alpine" ;; openwrt) echo "openwrt" ;; + unraid-os|slackware) echo "unraid" ;; *) echo "unknown" ;; esac elif [ -f /etc/openwrt_release ]; then @@ -68,6 +69,9 @@ create_user() { mkdir -p "/home/$USERNAME" chown "$USERNAME" "/home/$USERNAME" ;; + unraid) + useradd -m -s /bin/bash "$USERNAME" 2>/dev/null || true + ;; *) useradd --system --create-home --shell /bin/bash "$USERNAME" 2>/dev/null || \ adduser --system --group --shell /bin/bash --home "/home/$USERNAME" "$USERNAME" @@ -180,6 +184,10 @@ install_packages() { # Best-effort - not all packages exist on all architectures opkg install sudo lm-sensors pciutils ip-full coreutils-stat 2>/dev/null || true ;; + unraid) + # Unraid ships with most tools pre-installed + echo "Unraid detected - tools are pre-installed" + ;; *) echo "Warning: unknown OS, skipping package install" echo "Manually install: lm-sensors pciutils iproute2 util-linux"