Compare commits

...

34 commits

Author SHA1 Message Date
573b99f7cb
Update illumos support status. 2024-11-17 17:12:36 +00:00
c09d7c8298
Fix typo in illumos processor detection. 2024-11-13 20:17:45 +00:00
7a063fa170
Add processor detection for illumos. 2024-11-13 20:16:59 +00:00
9d8acac656
Add preliminary support for illumos (illumos). 2024-11-13 20:09:50 +00:00
1c484427e3
Add support for DragonFly BSD (freebsd/dfly). 2024-11-13 18:48:49 +00:00
77e0b50336
Change linux/android support status. 2024-11-13 16:55:14 +00:00
06a4eb3876
Extend processor detection on linux/android. 2024-11-13 16:52:36 +00:00
905e11c8fa
Add operating system detection for linux/android. 2024-11-13 16:40:07 +00:00
49354de8a5
Fix typo in linux/android processor detection. 2024-11-13 16:30:52 +00:00
6dbe52089f
Add processor detection on linux/android.
Also tweak how machine is detected on `linux/android`.
2024-11-13 16:29:25 +00:00
6bc504a4c9
Update table 2024-11-13 16:24:59 +00:00
800356790d
add preliminary android support 2024-11-13 16:23:19 +00:00
299078645f
meow 2024-11-13 16:06:52 +00:00
9c8a39fe31
cygwin has issues 2024-11-13 16:06:10 +00:00
cc850ee668
silly issue 2024-11-13 15:57:28 +00:00
826ed611b3
increase compatiblity with windows 2024-11-13 15:56:33 +00:00
86726e4e49
1.2.0: add windows support and streamline dev stuff 2024-11-12 19:37:56 +00:00
dccfe7585a
shift it 2024-11-12 19:33:32 +00:00
81d34ccdd8
add distro detection for windows 2024-11-12 19:32:30 +00:00
b5a6624f2d
typo 2024-11-12 19:21:07 +00:00
25083ef411
add machine detection support for windows 2024-11-12 19:20:36 +00:00
93d8341bad
generic wmic cpu support 2024-11-12 19:12:32 +00:00
0e11900adb
add CPU detection for cygwin 2024-11-12 19:03:12 +00:00
86801caef9
ugh another typo 2024-11-12 18:59:36 +00:00
bb5e2f3813
typo 2024-11-12 18:59:15 +00:00
2197cae12e
detect windows and cygwin 2024-11-12 18:58:36 +00:00
4a5daff432
didnt work. 2024-11-12 18:50:53 +00:00
c4e8cfe8ae
add cygwin specific build script 2024-11-12 18:48:53 +00:00
e7b1f334ba
switch to a build process 2024-11-12 17:53:59 +00:00
2d212cfd10
finish table adjusting 2024-11-12 17:36:22 +00:00
5a5759ead6
md tables suck 2024-11-12 17:35:56 +00:00
c319bb690f
update readme 2024-11-12 17:35:27 +00:00
e0e193e0b9
fix table 2024-11-12 16:55:10 +00:00
ee4ef73670
add support for netbsd, freebsd, and haiku 2024-11-12 16:54:35 +00:00
13 changed files with 312 additions and 197 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
abbiefetch

View file

@ -1,14 +1,25 @@
# abbiefetch # abbiefetch
abbiefetch is a POSIX compliant fetch script intended to be as portable as possible to run on machines of any age. abbiefetch is not dependent on any specific shell and should run fine on any system with a POSIX compliant shell and Unix utilities. abbiefetch is a POSIX compliant fetch script intended to be as portable as possible to run on machines of any age. abbiefetch is not dependent on any specific shell and should run fine on any system with a POSIX compliant shell and Unix utilities.
## Building
To build abbiefetch, clone this repository and run `./build.sh`. If you receive errors about `tee` having an invalid option then run `./build_alternate.sh`.
## Compatibility ## Compatibility
abbiefetch will attempt to gather as much information as possible on systems that don't have full compatibility and will provide you with a system type (and sometimes a subtype) to let you know what abbiefetch thinks your computer is running. abbiefetch will attempt to gather as much information as possible on systems that don't have full compatibility and will provide you with a system type (and sometimes a subtype) to let you know what abbiefetch thinks your computer is running.
| Type string | Kernel | System | | Type string | System type | Subtype | Support since | Support type | Notes |
| - | - | - | | - | - | - | - | - | - |
| `unknown` | Unknown kernel | | | `unknown` | Unknown kernel | | | None | Default when your system is unrecognised |
| `linux` | Linux | | | `linux` | Linux | | 1.0.0 | Full | |
| `linux/chumby` | Linux | Chumby internet appliances | | `linux/android` | Linux | Android | `master` | Full | |
| `linux/proxmox` | Linux | Proxmox VE host | | `linux/chumby` | Linux | Chumby internet appliances | 1.0.0 | Full | Uses chumby specific tools. |
| `linux/rpi` | Linux | Raspberry Pi single board computer | | `linux/proxmox` | Linux | Proxmox VE host | 1.0.0 | Full | |
| `openbsd` | OpenBSD | | | `linux/rpi` | Linux | Raspberry Pi single board computer | 1.0.0 | Partial | Currently there are issues detecting the host machine and CPU. |
| `openbsd` | OpenBSD | | 1.0.0 | Full | |
| `netbsd` | NetBSD | | 1.1.0 | Full | |
| `freebsd` | FreeBSD | | 1.1.0 | Full | |
| `freebsd/dfly` | FreeBSD | DragonFly BSD | `master` | Full | DragonFly is a fork of FreeBSD which is similar enough that no modifications need be made. |
| `haiku` | Haiku | | 1.1.0 | Partial | |
| `windows` | Microsoft Windows | | 1.2.0 | Full | Relies on wmic.exe and systeminfo.exe |
| `windows/cygwin` | Microsoft Windows | Cygwin | 1.2.0 | Partial | Relies on wmic.exe and systeminfo.exe, issues with machine detection |
| `illumos` | illumos | | `master` | Partial | |

View file

@ -1,189 +0,0 @@
#!/bin/sh
system_type="unknown"
subtype="none"
username="(user)"
hostname="(none)"
hashostname=0
hasawk=0
haslspci=0
hasglxinfo=0
hassed=0
command -v hostname >>/dev/null
if [ "$?" -eq 0 ]; then
hashostname=1
fi
command -v awk >>/dev/null
if [ "$?" -eq 0 ]; then
hasawk=1
fi
command -v lspci >>/dev/null
if [ "$?" -eq 0 ]; then
haslspci=1
fi
command -v glxinfo >>/dev/null
if [ "$?" -eq 0 ]; then
hasglxinfo=1
fi
command -v sed >>/dev/null
if [ "$?" -eq 0 ]; then
hassed=1
fi
command -v chumby_version >>/dev/null
if [ "$?" -eq 0 ] && [ "$system_type" = "unknown" ]; then
system_type="linux"
subtype="chumby"
fi
command -v raspi-config >>/dev/null
if [ "$?" -eq 0 ] && [ "$system_type" = "unknown" ]; then
system_type="linux"
subtype="rpi"
fi
command -v pveversion >>/dev/null
if [ "$?" -eq 0 ] && [ "$system_type" = "unknown" ]; then
system_type="linux"
subtype="proxmox"
fi
if [ "$(uname -s)" = "Linux" ] && [ "$system_type" = "unknown" ]; then
system_type="linux"
fi
if [ "$(uname -s)" = "OpenBSD" ] && [ "$system_type" = "unknown" ]; then
system_type="openbsd"
fi
if [ "$hashostname" -eq 1 ]; then
hostname="$(hostname)"
elif [ -n "$(cat /etc/hostname)" ]; then
hostname="$(cat /etc/hostname)"
fi
if [ -n "$(whoami)" ]; then
username="$(whoami)"
fi
if [ "$hasawk" -eq 1 ] && [ $system_type = "openbsd" ] && [ -z "$processor" ]; then
processor="$(sysctl hw.model | awk -F "=" '{print $2}')"
fi
if [ "$hasawk" -eq 1 ] && [ $system_type = "linux" ] && [ -z "$processor" ]; then
if [ -n "$(cat /proc/cpuinfo | grep "model name" | head -n 1 | awk -F ": " '{print $2}')" ]; then
processor="$(cat /proc/cpuinfo | grep "model name" | head -n 1 | awk -F ": " '{print $2}')"
elif [ -n "$(cat /proc/cpuinfo | grep -v "cpuid" | grep -v "Hz" | grep -v "cpu number" | grep -v "cpu regs" | grep "cpu" | head -n 1 | awk -F ": " '{print $2}')" ]; then
processor="$(cat /proc/cpuinfo | grep -v "cpuid" | grep -v "Hz" | grep -v "cpu number" | grep -v "cpu regs" | grep "cpu" | head -n 1 | awk -F ": " '{print $2}')"
elif [ -n "$(cat /proc/cpuinfo | grep "Hardware" | head -n 1 | awk -F ": " '{print $2}')" ] && [ $subtype = "chumby" -o $subtype = "rpi" ]; then
processor="$(cat /proc/cpuinfo | grep "Hardware" | head -n 1 | awk -F ": " '{print $2}')"
elif [ -n "$(cat /proc/cpuinfo | grep "family" | head -n 1 | awk -F ": " '{print $2}')" ]; then
processor="$(cat /proc/cpuinfo | grep "family" | head -n 1 | awk -F ": " '{print $2}')"
elif [ -n "$(cat /proc/cpuinfo | grep "Processor" | head -n 1 | awk -F ": " '{print $2}')" ]; then
processor="$(cat /proc/cpuinfo | grep "Processor" | head -n 1 | awk -F ": " '{print $2}')"
fi
fi
if [ "$hassed" -eq 1 ] && [ "$hasawk" -eq 1 ] && [ -n "$processor" ]; then
if [ -n "$(echo $processor | awk -F "@" '{print $1}' | sed "s/Processor//g" | sed "s/CPU//g" | sed "s/(R)//g" | sed "s/(r)//g" | sed "s/(TM)//g" | sed "s/(tm)//g" | tr -s " ")" ]; then
processor="$(echo $processor | awk -F "@" '{print $1}' | sed "s/Processor//g" | sed "s/CPU//g" | sed "s/(R)//g" | sed "s/(r)//g" | sed "s/(TM)//g" | sed "s/(tm)//g" | tr -s " ")"
fi
fi
if [ -n "$(uname -r)" ] && [ -z "$kernel" ]; then
kernel="$(uname -s) $(uname -r)"
fi
if [ -n "$(uname -s)" ] && [ -z "$kernel" ]; then
kernel="$(uname -s)"
fi
if [ "$hasglxinfo" -eq 1 ] && [ "$hasawk" -eq 1 ] && [ -z "$graphics" ]; then
if [ -n "$(glxinfo | grep "OpenGL renderer string" | awk -F ": " '{print $2}' | awk -F "(" '{print $1}')" ]; then
graphics="$(glxinfo | grep "OpenGL renderer string" | awk -F ": " '{print $2}' | awk -F "(" '{print $1}')"
fi
fi
if [ "$haslspci" -eq 1 ] && [ "$hasawk" -eq 1 ] && [ -z "$graphics" ]; then
if [ -n "$(lspci | grep "VGA compatible controller" | awk -F "controller: " '{print $2}')" ]; then
graphics="$(lspci | grep "VGA compatible controller" | awk -F "controller: " '{print $2}')"
fi
fi
if [ -f /etc/lsb-release ] && [ $system_type = "linux" ]; then
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
if [ -f /etc/os-release ] && [ $system_type = "linux" ]; then
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
if [ $subtype = "chumby" ]; then
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
if [ $subtype = "proxmox" ]; then
if [ "$hasawk" -eq 1 ]; then
if [ -n "$(pveversion | awk -F "/" '{ print $2 }')" ]; then
distro="Proxmox VE $(pveversion | awk -F "/" '{ print $2 }')"
fi
fi
fi
if [ $system_type = "openbsd" ]; then
if [ "$hasawk" -eq 1 ]; then
distro="$(sysctl kern.osrevision | awk -F "=" '{print $2}')"
machine="$(sysctl hw.vendor | awk -F "=" '{print $2}') $(sysctl hw.product | awk -F "=" '{print $2}')"
fi
fi
if [ $system_type = "linux" ] && [ -z "$machine" ]; then
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
if [ "$subtype" = "none" ]; then
echo "$username@$hostname ($system_type)"
else
echo "$username@$hostname ($system_type/$subtype)"
fi
echo
if [ -n "$processor" ]; then
echo "cpu: $processor"
fi
if [ -n "$graphics" ]; then
echo "gpu: $graphics"
fi
if [ -n "$kernel" ]; then
echo "krn: $kernel"
fi
if [ -n "$distro" ]; then
echo "sys: $distro"
fi
if [ -n "$machine" ]; then
echo "mac: $machine"
fi

10
build.sh Executable file
View file

@ -0,0 +1,10 @@
#!/bin/sh
cat probing.1 | tee -p abbiefetch
cat system_detection.2 | tee -ap abbiefetch
cat hostname_username.3 | tee -ap abbiefetch
cat processor_detection.4 | tee -ap abbiefetch
cat kernel_info.5 | tee -ap abbiefetch
cat gpu_detection.6 | tee -ap abbiefetch
cat distro_machine_detection.7 | tee -ap abbiefetch
cat display_results.8 | tee -ap abbiefetch
chmod +x abbiefetch

10
build_alternate.sh Executable file
View file

@ -0,0 +1,10 @@
#!/bin/sh
cat probing.1 | tee abbiefetch
cat system_detection.2 | tee -a abbiefetch
cat hostname_username.3 | tee -a abbiefetch
cat processor_detection.4 | tee -a abbiefetch
cat kernel_info.5 | tee -a abbiefetch
cat gpu_detection.6 | tee -a abbiefetch
cat distro_machine_detection.7 | tee -a abbiefetch
cat display_results.8 | tee -a abbiefetch
chmod +x abbiefetch

25
display_results.8 Normal file
View file

@ -0,0 +1,25 @@
if [ "$subtype" = "none" ]; then
echo "$username@$hostname ($system_type)"
else
echo "$username@$hostname ($system_type/$subtype)"
fi
echo
if [ -n "$processor" ]; then
echo "cpu: $processor"
fi
if [ -n "$graphics" ]; then
echo "gpu: $graphics"
fi
if [ -n "$kernel" ]; then
echo "krn: $kernel"
fi
if [ -n "$distro" ]; then
if [ "$system_type" = "windows" ]; then
echo "sys:$distro"
else
echo "sys: $distro"
fi
fi
if [ -n "$machine" ]; then
echo "mac: $machine"
fi

View file

@ -0,0 +1,89 @@
if [ -f /etc/lsb-release ] && [ "$system_type" = "linux" ]; then
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
if [ -f /etc/os-release ] && [ "$system_type" = "linux" ]; then
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
if [ "$subtype" = "chumby" ]; then
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
if [ "$subtype" = "proxmox" ]; then
if [ "$hasawk" -eq 1 ]; then
if [ -n "$(pveversion | awk -F "/" '{ print $2 }')" ]; then
distro="Proxmox VE $(pveversion | awk -F "/" '{ print $2 }')"
fi
fi
fi
if [ "$subtype" = "android" ]; then
if [ -n "$(getprop ro.product.manufacturer)$(getprop ro.product.model)" ]; then
machine="$(getprop ro.product.manufacturer) $(getprop ro.product.model)"
fi
if [ -n "$(getprop ro.build.version.release)" ]; then
distro="Android $(getprop ro.build.version.release)"
fi
fi
if [ "$system_type" = "openbsd" ]; then
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
if [ "$system_type" = "freebsd" ]; then
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
if [ "$system_type" = "netbsd" ]; then
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
if [ "$system_type" = "haiku" ]; then
distro="$(uname -v)"
fi
if [ "$system_type" = "linux" ] && [ -z "$machine" ]; then
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
if [ "$system_type" = "windows" ] && [ -z "$machine"] && [ "$hassed" -eq 1 ]; then
if [ "$hasawk" -eq 1 ]; then
distro="$(systeminfo.exe 2>/dev/null | grep -v "BIOS" | grep "OS Version" | awk -F ":" '{print $2}' | tr -s " ")"
fi
if [ "$subtype" = "cygwin" ]; then
machine=0
else
machine="$(wmic.exe computersystem get Manufacturer | sed -n 2p | head -n 1 | tr -s " ")$(wmic.exe computersystem get Model | sed -n 2p | head -n 1)"
fi
fi

10
gpu_detection.6 Normal file
View file

@ -0,0 +1,10 @@
if [ "$hasglxinfo" -eq 1 ] && [ "$hasawk" -eq 1 ] && [ -z "$graphics" ]; then
if [ -n "$(glxinfo 2>/dev/null | grep "OpenGL renderer string" | awk -F ": " '{print $2}' | awk -F "(" '{print $1}')" ]; then
graphics="$(glxinfo 2>/dev/null | grep "OpenGL renderer string" | awk -F ": " '{print $2}' | awk -F "(" '{print $1}')"
fi
fi
if [ "$haslspci" -eq 1 ] && [ "$hasawk" -eq 1 ] && [ -z "$graphics" ]; then
if [ -n "$(lspci | grep "VGA compatible controller" | awk -F "controller: " '{print $2}')" ]; then
graphics="$(lspci | grep "VGA compatible controller" | awk -F "controller: " '{print $2}')"
fi
fi

9
hostname_username.3 Normal file
View file

@ -0,0 +1,9 @@
if [ "$hashostname" -eq 1 ]; then
hostname="$(hostname)"
elif [ -n "$(cat /etc/hostname)" ]; then
hostname="$(cat /etc/hostname)"
fi
if [ -n "$(whoami)" ]; then
username="$(whoami)"
fi

9
kernel_info.5 Normal file
View file

@ -0,0 +1,9 @@
if [ -n "$(uname -r)" ] && [ -z "$kernel" ]; then
kernel="$(uname -s) $(uname -r)"
fi
if [ -n "$(uname -s)" ] && [ -z "$kernel" ]; then
kernel="$(uname -s)"
fi
if [ "$system_type" = "illumos" ]; then
kernel="$(uname -v)"
fi

37
probing.1 Normal file
View file

@ -0,0 +1,37 @@
#!/bin/sh
system_type="unknown"
subtype="none"
username="(user)"
hostname="(none)"
hashostname=0
hasawk=0
haslspci=0
hasglxinfo=0
hassed=0
command -v hostname >>/dev/null
if [ "$?" -eq 0 ]; then
hashostname=1
fi
command -v awk >>/dev/null
if [ "$?" -eq 0 ]; then
hasawk=1
fi
command -v lspci >>/dev/null
if [ "$?" -eq 0 ]; then
haslspci=1
fi
command -v glxinfo >>/dev/null
if [ "$?" -eq 0 ]; then
hasglxinfo=1
fi
command -v sed >>/dev/null
if [ "$?" -eq 0 ]; then
hassed=1
fi

47
processor_detection.4 Normal file
View file

@ -0,0 +1,47 @@
if [ "$hasawk" -eq 1 ] && [ "$system_type" = "openbsd" ] && [ -z "$processor" ]; then
processor="$(sysctl hw.model | awk -F "=" '{print $2}')"
fi
if [ "$hasawk" -eq 1 ] && [ "$system_type" = "freebsd" ] && [ -z "$processor" ]; then
processor="$(sysctl hw.model | awk -F ": " '{print $2}')"
fi
if [ "$hasawk" -eq 1 ] && [ "$system_type" = "netbsd" ] && [ -z "$processor" ]; then
processor="$(sysctl machdep.cpu_brand | awk -F " = " '{print $2}')"
fi
if [ "$hasawk" -eq 1 ] && [ "$system_type" = "haiku" ] && [ -z "$processor" ]; then
processor="$(sysinfo | grep "CPU #0" | awk -F "\"" '{ print $2 }')"
fi
if [ "$hasawk" -eq 1 ] && [ "$system_type" = "linux" ] || [ "$system_type" = "windows" -a "$subtype" = "cygwin" ] && [ -z "$processor" ]; then
if [ -n "$(cat /proc/cpuinfo | grep "model name" | head -n 1 | awk -F ": " '{print $2}')" ]; then
processor="$(cat /proc/cpuinfo | grep "model name" | head -n 1 | awk -F ": " '{print $2}')"
elif [ -n "$(cat /proc/cpuinfo | grep -v "cpuid" | grep -v "Hz" | grep -v "cpu number" | grep -v "cpu regs" | grep "cpu" | head -n 1 | awk -F ": " '{print $2}')" ]; then
processor="$(cat /proc/cpuinfo | grep -v "cpuid" | grep -v "Hz" | grep -v "cpu number" | grep -v "cpu regs" | grep "cpu" | head -n 1 | awk -F ": " '{print $2}')"
elif [ -n "$(cat /proc/cpuinfo | grep "Hardware" | head -n 1 | awk -F ": " '{print $2}')" ] && [ "$subtype" = "chumby" -o "$subtype" = "rpi" ]; then
processor="$(cat /proc/cpuinfo | grep "Hardware" | head -n 1 | awk -F ": " '{print $2}')"
elif [ -n "$(cat /proc/cpuinfo | grep "family" | head -n 1 | awk -F ": " '{print $2}')" ]; then
processor="$(cat /proc/cpuinfo | grep "family" | head -n 1 | awk -F ": " '{print $2}')"
elif [ -n "$(cat /proc/cpuinfo | grep "Processor" | head -n 1 | awk -F ": " '{print $2}')" ]; then
processor="$(cat /proc/cpuinfo | grep "Processor" | head -n 1 | awk -F ": " '{print $2}')"
fi
fi
if [ "$hassed" -eq 1 ] && [ "$system_type" = "windows" ] && [ -z "$processor" ]; then
if [ -n "$(wmic.exe cpu get name | sed -n 2p | head -n 1)" ]; then
processor="$(wmic.exe cpu get name | sed -n 2p | head -n 1)"
fi
fi
if [ "$subtype" = "android" ]; then
if [ -n "$(getprop ro.soc.manufacturer)$(getprop ro.soc.model)" ]; then
processor="$(getprop ro.soc.manufacturer) $(getprop ro.soc.model)"
elif [ -n "$(getprop ro.hardware.chipname)" ]; then
processor="$(getprop ro.hardware.chipname)"
fi
fi
if [ "$hasawk" -eq 1 ] && [ "$system_type" = "illumos" ] && [ -z "$processor" ]; then
if [ -n "$(kstat | grep brand)" ]; then
processor="$(kstat | grep brand | head -n 1 | tr -s " " | awk -F "brand " '{print $2}')"
fi
fi
if [ "$hassed" -eq 1 ] && [ "$hasawk" -eq 1 ] && [ -n "$processor" ]; then
if [ -n "$(echo $processor | awk -F "@" '{print $1}' | sed "s/Processor//g" | sed "s/CPU//g" | sed "s/(R)//g" | sed "s/(r)//g" | sed "s/(TM)//g" | sed "s/(tm)//g" | tr -s " ")" ]; then
processor="$(echo $processor | awk -F "@" '{print $1}' | sed "s/Processor//g" | sed "s/CPU//g" | sed "s/(R)//g" | sed "s/(r)//g" | sed "s/(TM)//g" | sed "s/(tm)//g" | tr -s " ")"
fi
fi

46
system_detection.2 Normal file
View file

@ -0,0 +1,46 @@
if [ "$(uname -s)" = "Linux" ] && [ "$system_type" = "unknown" ]; then
system_type="linux"
command -v chumby_version >>/dev/null
if [ "$?" -eq 0 ] && [ "$subtype" = "none" ]; then
subtype="chumby"
fi
command -v raspi-config >>/dev/null
if [ "$?" -eq 0 ] && [ "$subtype" = "none" ]; then
subtype="rpi"
fi
command -v pveversion >>/dev/null
if [ "$?" -eq 0 ] && [ "$subtype" = "none" ]; then
subtype="proxmox"
fi
command -v getprop >>/dev/null
if [ "$?" -eq 0 ] && [ "$subtype" = "none" ]; then
subtype="android"
haslspci=0
fi
fi
if [ "$(uname -s)" = "OpenBSD" ] && [ "$system_type" = "unknown" ]; then
system_type="openbsd"
fi
if [ "$(uname -s)" = "FreeBSD" ] && [ "$system_type" = "unknown" ]; then
system_type="freebsd"
fi
if [ "$(uname -s)" = "DragonFly" ] && [ "$system_type" = "unknown" ]; then
system_type="freebsd"
subtype="dfly"
fi
if [ "$(uname -s)" = "NetBSD" ] && [ "$system_type" = "unknown" ]; then
system_type="netbsd"
fi
if [ "$(uname -s)" = "Haiku" ] && [ "$system_type" = "unknown" ]; then
system_type="haiku"
fi
command -v winver.exe >>/dev/null
if [ "$?" -eq 0 ] && [ "$system_type" = "unknown" ]; then
system_type="windows"
if [ "$(uname -o)" = "Cygwin" ]; then
subtype="cygwin"
fi
fi
if [ "$(uname -o)" = "illumos" ] && [ "$system_type" = "unknown" ]; then
system_type="illumos"
fi