2024-11-12 19:20:36 +00:00
|
|
|
if [ -f /etc/lsb-release ] && [ "$system_type" = "linux" ]; then
|
2024-11-12 17:53:59 +00:00
|
|
|
if [ "$hasawk" -eq 1 ] && [ -z "$distro" ]; then
|
|
|
|
if [ -n "$(cat /etc/lsb-release | grep DISTRIB_DESCRIPTION | awk -F "\"" '{print $2}') $(cat /etc/lsb-release | grep DISTRIB_RELEASE | awk -F "\"" '{print $2}')" ] && [ "$(cat /etc/lsb-release | grep DISTRIB_RELEASE | awk -F "\"" '{print $2}')" != "rolling" ]; then
|
|
|
|
distro="$(cat /etc/lsb-release | grep DISTRIB_DESCRIPTION | awk -F "\"" '{print $2}') $(cat /etc/lsb-release | grep DISTRIB_RELEASE | awk -F "\"" '{print $2}')"
|
|
|
|
elif [ -n "$(cat /etc/lsb-release | grep DISTRIB_DESCRIPTION | awk -F "\"" '{print $2}')" ]; then
|
|
|
|
distro="$(cat /etc/lsb-release | grep DISTRIB_DESCRIPTION | awk -F "\"" '{print $2}')"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
2024-11-12 19:20:36 +00:00
|
|
|
if [ -f /etc/os-release ] && [ "$system_type" = "linux" ]; then
|
2024-11-12 17:53:59 +00:00
|
|
|
if [ "$hasawk" -eq 1 ] && [ -z "$distro" ]; then
|
|
|
|
if [ -n "$(cat /etc/os-release | grep PRETTY_NAME | awk -F "\"" '{print $2}')" ]; then
|
|
|
|
distro="$(cat /etc/os-release | grep PRETTY_NAME | awk -F "\"" '{print $2}')"
|
|
|
|
elif [ -n "$(cat /etc/os-release | grep NAME | awk -F "\"" '{print $2}')" ]; then
|
|
|
|
distro="$(cat /etc/os-release | grep NAME | awk -F "\"" '{print $2}')"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
2024-11-12 19:20:36 +00:00
|
|
|
if [ "$subtype" = "chumby" ]; then
|
2024-11-12 17:53:59 +00:00
|
|
|
distro="Chumby firmware $(chumby_version -s)"
|
|
|
|
if [ "$hasawk" -eq 1 ]; then
|
|
|
|
if [ "$(chumby_version -h | awk -F "." '{print $1}')" = "3" ]; then
|
|
|
|
machine="Chumby Classic"
|
|
|
|
elif [ "$(chumby_version -h | awk -F "." '{print $1}')" = "10" ]; then
|
|
|
|
machine="Chumby One"
|
|
|
|
elif [ "$(chumby_version -h | awk -F "." '{print $1}')" = "7" ]; then
|
|
|
|
machine="Insignia Infocast 3.5\""
|
|
|
|
else
|
|
|
|
machine="Chumby-enabled device"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
2024-11-12 19:20:36 +00:00
|
|
|
if [ "$subtype" = "proxmox" ]; then
|
2024-11-12 17:53:59 +00:00
|
|
|
if [ "$hasawk" -eq 1 ]; then
|
|
|
|
if [ -n "$(pveversion | awk -F "/" '{ print $2 }')" ]; then
|
|
|
|
distro="Proxmox VE $(pveversion | awk -F "/" '{ print $2 }')"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
2024-11-12 19:20:36 +00:00
|
|
|
if [ "$system_type" = "openbsd" ]; then
|
2024-11-12 17:53:59 +00:00
|
|
|
if [ "$hasawk" -eq 1 ]; then
|
|
|
|
distro="revision $(sysctl kern.osrevision | awk -F "=" '{print $2}')"
|
|
|
|
machine="$(sysctl hw.vendor | awk -F "=" '{print $2}') $(sysctl hw.product | awk -F "=" '{print $2}')"
|
|
|
|
fi
|
|
|
|
fi
|
2024-11-12 19:20:36 +00:00
|
|
|
if [ "$system_type" = "freebsd" ]; then
|
2024-11-12 17:53:59 +00:00
|
|
|
if [ "$hasawk" -eq 1 ]; then
|
|
|
|
distro="revision $(sysctl kern.osrevision | awk -F ": " '{print $2}')"
|
|
|
|
fi
|
|
|
|
machine="$(kenv smbios.system.maker) $(kenv smbios.system.product)"
|
|
|
|
fi
|
2024-11-12 19:20:36 +00:00
|
|
|
if [ "$system_type" = "netbsd" ]; then
|
2024-11-12 17:53:59 +00:00
|
|
|
if [ "$hasawk" -eq 1 ]; then
|
|
|
|
distro="revision $(sysctl kern.osrevision | awk -F " = " '{print $2}')"
|
|
|
|
machine="$(sysctl machdep.dmi.system-vendor | awk -F " = " '{print $2}') $(sysctl machdep.dmi.system-product | awk -F " = " '{print $2}')"
|
|
|
|
fi
|
|
|
|
fi
|
2024-11-12 19:20:36 +00:00
|
|
|
if [ "$system_type" = "haiku" ]; then
|
2024-11-12 17:53:59 +00:00
|
|
|
distro="$(uname -v)"
|
|
|
|
fi
|
|
|
|
|
2024-11-12 19:20:36 +00:00
|
|
|
if [ "$system_type" = "linux" ] && [ -z "$machine" ]; then
|
2024-11-12 17:53:59 +00:00
|
|
|
if [ -f "/sys/devices/virtual/dmi/id/product_name" ]; then
|
|
|
|
machine="$(cat /sys/devices/virtual/dmi/id/product_name)"
|
|
|
|
fi
|
|
|
|
if [ -f "/sys/devices/virtual/dmi/id/sys_vendor" ]; then
|
|
|
|
machine="$(cat /sys/devices/virtual/dmi/id/sys_vendor) $machine"
|
|
|
|
fi
|
|
|
|
fi
|
2024-11-12 19:20:36 +00:00
|
|
|
|
|
|
|
if [ "$system_type" = "windows" ] && [ -z "$machine"]; && [ "$hassed" -eq 1 ]; then
|
|
|
|
machine="$(wmic.exe computersystem get Manufacturer,Model | sed -n 2p | head -n 1)"
|
|
|
|
fi
|