Compare commits
32 commits
Author | SHA1 | Date | |
---|---|---|---|
573b99f7cb | |||
c09d7c8298 | |||
7a063fa170 | |||
9d8acac656 | |||
1c484427e3 | |||
77e0b50336 | |||
06a4eb3876 | |||
905e11c8fa | |||
49354de8a5 | |||
6dbe52089f | |||
6bc504a4c9 | |||
800356790d | |||
299078645f | |||
9c8a39fe31 | |||
cc850ee668 | |||
826ed611b3 | |||
86726e4e49 | |||
dccfe7585a | |||
81d34ccdd8 | |||
b5a6624f2d | |||
25083ef411 | |||
93d8341bad | |||
0e11900adb | |||
86801caef9 | |||
bb5e2f3813 | |||
2197cae12e | |||
4a5daff432 | |||
c4e8cfe8ae | |||
e7b1f334ba | |||
2d212cfd10 | |||
5a5759ead6 | |||
c319bb690f |
13 changed files with 312 additions and 227 deletions
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
abbiefetch
|
30
README.md
30
README.md
|
@ -1,17 +1,25 @@
|
|||
# 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.
|
||||
|
||||
## 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
|
||||
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 | System type | Subtype | Support since |
|
||||
| - | - | - | - |
|
||||
| `unknown` | Unknown kernel | | |
|
||||
| `linux` | Linux | | 1.0.0 |
|
||||
| `linux/chumby` | Linux | Chumby internet appliances | 1.0.0 |
|
||||
| `linux/proxmox` | Linux | Proxmox VE host | 1.0.0 |
|
||||
| `linux/rpi` | Linux | Raspberry Pi single board computer | 1.0.0 |
|
||||
| `openbsd` | OpenBSD | | 1.0.0 |
|
||||
| `netbsd` | NetBSD | | 1.1.0 |
|
||||
| `freebsd` | FreeBSD | | 1.1.0 |
|
||||
| `haiku` | Haiku | | 1.1.0 |
|
||||
| Type string | System type | Subtype | Support since | Support type | Notes |
|
||||
| - | - | - | - | - | - |
|
||||
| `unknown` | Unknown kernel | | | None | Default when your system is unrecognised |
|
||||
| `linux` | Linux | | 1.0.0 | Full | |
|
||||
| `linux/android` | Linux | Android | `master` | Full | |
|
||||
| `linux/chumby` | Linux | Chumby internet appliances | 1.0.0 | Full | Uses chumby specific tools. |
|
||||
| `linux/proxmox` | Linux | Proxmox VE host | 1.0.0 | Full | |
|
||||
| `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 | |
|
||||
|
|
216
abbiefetch
216
abbiefetch
|
@ -1,216 +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
|
||||
|
||||
|
||||
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
|
||||
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)" = "NetBSD" ] && [ "$system_type" = "unknown" ]; then
|
||||
system_type="netbsd"
|
||||
fi
|
||||
if [ "$(uname -s)" = "Haiku" ] && [ "$system_type" = "unknown" ]; then
|
||||
system_type="haiku"
|
||||
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 = "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" ] && [ -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 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
|
||||
|
||||
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="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 [ "$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
10
build.sh
Executable 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
10
build_alternate.sh
Executable 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
25
display_results.8
Normal 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
|
89
distro_machine_detection.7
Normal file
89
distro_machine_detection.7
Normal 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
10
gpu_detection.6
Normal 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
9
hostname_username.3
Normal 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
9
kernel_info.5
Normal 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
37
probing.1
Normal 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
47
processor_detection.4
Normal 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
46
system_detection.2
Normal 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
|
Loading…
Reference in a new issue