Add Unraid support and fix lscpu parsing for colon-separated fields
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user