arc-functions: fix logic

Signed-off-by: AuxXxilium <info@auxxxilium.tech>
This commit is contained in:
AuxXxilium 2024-11-10 00:16:03 +01:00
parent 8de9970341
commit f50bb9cc46

View File

@ -970,11 +970,6 @@ function sysinfo() {
TEXT+="\n CPU: \Zb${CPU}\Zn" TEXT+="\n CPU: \Zb${CPU}\Zn"
if [ $(lspci -d ::300 | wc -l) -gt 0 ]; then if [ $(lspci -d ::300 | wc -l) -gt 0 ]; then
for PCI in $(lspci -d ::300 | awk '{print $1}'); do for PCI in $(lspci -d ::300 | awk '{print $1}'); do
GPUNAME=$(lspci -s ${PCI} | sed "s/\ .*://" | awk '{$1=""}1' | awk '{$1=$1};1')
TEXT+="\n iGPU: \Zb${GPUNAME}\Zn"
done
elif [ $(lspci -d ::380 | wc -l) -gt 0 ]; then
for PCI in $(lspci -d ::380 | awk '{print $1}'); do
GPUNAME=$(lspci -s ${PCI} | sed "s/\ .*://" | awk '{$1=""}1' | awk '{$1=$1};1') GPUNAME=$(lspci -s ${PCI} | sed "s/\ .*://" | awk '{$1=""}1' | awk '{$1=$1};1')
TEXT+="\n GPU: \Zb${GPUNAME}\Zn" TEXT+="\n GPU: \Zb${GPUNAME}\Zn"
done done
@ -1097,7 +1092,7 @@ function sysinfo() {
TEXT+="\Zb ${NAME}\Zn\n Disks: ${PORTNUM}\n" TEXT+="\Zb ${NAME}\Zn\n Disks: ${PORTNUM}\n"
NUMPORTS=$((${NUMPORTS} + ${PORTNUM})) NUMPORTS=$((${NUMPORTS} + ${PORTNUM}))
done done
[ $(lspci -d ::107 2>/dev/null | wc -l) -gt 0 ] && TEXT+="\nHBA Controller:\n" [ $(lspci -d ::107 2>/dev/null | wc -l) -gt 0 ] && TEXT+="\n HBA Controller:\n"
for PCI in $(lspci -d ::107 2>/dev/null | awk '{print $1}'); do for PCI in $(lspci -d ::107 2>/dev/null | awk '{print $1}'); do
NAME=$(lspci -s "${PCI}" 2>/dev/null | sed "s/\ .*://") NAME=$(lspci -s "${PCI}" 2>/dev/null | sed "s/\ .*://")
PORT=$(ls -l /sys/class/scsi_host 2>/dev/null | grep "${PCI}" | awk -F'/' '{print $NF}' | sed 's/host//' | sort -n) PORT=$(ls -l /sys/class/scsi_host 2>/dev/null | grep "${PCI}" | awk -F'/' '{print $NF}' | sed 's/host//' | sort -n)
@ -1113,14 +1108,6 @@ function sysinfo() {
TEXT+="\Zb ${NAME}\Zn\n Disks: ${PORTNUM}\n" TEXT+="\Zb ${NAME}\Zn\n Disks: ${PORTNUM}\n"
NUMPORTS=$((${NUMPORTS} + ${PORTNUM})) NUMPORTS=$((${NUMPORTS} + ${PORTNUM}))
done done
[ $(lspci -d ::101 2>/dev/null | wc -l) -gt 0 ] && TEXT+="\n IDE Controller:\n"
for PCI in $(lspci -d ::101 2>/dev/null | awk '{print $1}'); do
NAME=$(lspci -s "${PCI}" 2>/dev/null | sed "s/\ .*://")
PORTNUM=$(ls -l /sys/block/* 2>/dev/null | grep "${PCI}" | wc -l)
[ ${PORTNUM} -eq 0 ] && continue
TEXT+="\Zb ${NAME}\Zn\n Disks: ${PORTNUM}\n"
NUMPORTS=$((${NUMPORTS} + ${PORTNUM}))
done
[ $(ls -l /sys/class/scsi_host 2>/dev/null | grep usb | wc -l) -gt 0 ] && TEXT+="\n USB Controller:\n" [ $(ls -l /sys/class/scsi_host 2>/dev/null | grep usb | wc -l) -gt 0 ] && TEXT+="\n USB Controller:\n"
for PCI in $(lspci -d ::c03 2>/dev/null | awk '{print $1}'); do for PCI in $(lspci -d ::c03 2>/dev/null | awk '{print $1}'); do
NAME=$(lspci -s "${PCI}" 2>/dev/null | sed "s/\ .*://") NAME=$(lspci -s "${PCI}" 2>/dev/null | sed "s/\ .*://")