mirror of
https://github.com/AuxXxilium/arc.git
synced 2024-11-24 00:59:53 +07:00
arc-functions: rework sysinfo
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
This commit is contained in:
parent
fe642ebec2
commit
6b315e08ad
@ -1089,67 +1089,69 @@ function sysinfo() {
|
|||||||
TEXT+="\n Ports with color \Z1\Zbred\Zn as DUMMY, color \Z2\Zbgreen\Zn has a Disk connected.\n"
|
TEXT+="\n Ports with color \Z1\Zbred\Zn as DUMMY, color \Z2\Zbgreen\Zn has a Disk connected.\n"
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
if [ $(lspci -d ::107 | wc -l) -gt 0 ]; then
|
[ $(lspci -d ::104 2>/dev/null | wc -l) -gt 0 ] && TEXT+="\n RAID Controller:\n"
|
||||||
TEXT+="\n SAS Controller:\n"
|
for PCI in $(lspci -d ::104 2>/dev/null | awk '{print $1}'); do
|
||||||
for PCI in $(lspci -d ::107 | awk '{print $1}'); do
|
NAME=$(lspci -s "${PCI}" 2>/dev/null | sed "s/\ .*://")
|
||||||
NAME=$(lspci -s "${PCI}" | sed "s/\ .*://" | awk '{$1=""}1' | awk '{$1=$1};1')
|
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 | grep "${PCI}" | awk -F'/' '{print $NF}' | sed 's/host//' | sort -n)
|
PORTNUM=$(lsscsi -b 2>/dev/null | grep -v - | grep "\[${PORT}:" | wc -l)
|
||||||
PORTNUM=$(lsscsi -b | grep -v - | grep "\[${PORT}:" | wc -l)
|
TEXT+="\Zb ${NAME}\Zn\nNumber: ${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"
|
||||||
fi
|
for PCI in $(lspci -d ::107 2>/dev/null | awk '{print $1}'); do
|
||||||
if [ $(lspci -d ::104 | wc -l) -gt 0 ]; then
|
NAME=$(lspci -s "${PCI}" 2>/dev/null | sed "s/\ .*://")
|
||||||
TEXT+="\n Raid Controller:\n"
|
PORT=$(ls -l /sys/class/scsi_host 2>/dev/null | grep "${PCI}" | awk -F'/' '{print $NF}' | sed 's/host//' | sort -n)
|
||||||
for PCI in $(lspci -d ::104 | awk '{print $1}'); do
|
PORTNUM=$(lsscsi -b 2>/dev/null | grep -v - | grep "\[${PORT}:" | wc -l)
|
||||||
NAME=$(lspci -s "${PCI}" | sed "s/\ .*://" | awk '{$1=""}1' | awk '{$1=$1};1')
|
TEXT+="\Zb ${NAME}\Zn\nNumber: ${PORTNUM}\n"
|
||||||
PORT=$(ls -l /sys/class/scsi_host | grep "${PCI}" | awk -F'/' '{print $NF}' | sed 's/host//' | sort -n)
|
NUMPORTS=$((${NUMPORTS} + ${PORTNUM}))
|
||||||
PORTNUM=$(lsscsi -b | grep -v - | grep "\[${PORT}:" | wc -l)
|
done
|
||||||
TEXT+="\Zb ${NAME}\Zn\n Disks: ${PORTNUM}\n"
|
[ $(lspci -d ::100 2>/dev/null | wc -l) -gt 0 ] && TEXT+="\n SCSI Controller:\n"
|
||||||
NUMPORTS=$((${NUMPORTS} + ${PORTNUM}))
|
for PCI in $(lspci -d ::100 2>/dev/null | awk '{print $1}'); do
|
||||||
done
|
NAME=$(lspci -s "${PCI}" 2>/dev/null | sed "s/\ .*://")
|
||||||
fi
|
PORTNUM=$(ls -l /sys/block/* 2>/dev/null | grep "${PCI}" | wc -l)
|
||||||
if [ $(lspci -d ::100 | wc -l) -gt 0 ]; then
|
[ ${PORTNUM} -eq 0 ] && continue
|
||||||
TEXT+="\n SCSI Controller:\n"
|
TEXT+="\Zb ${NAME}\Zn\nNumber: ${PORTNUM}\n"
|
||||||
for PCI in $(lspci -d ::100 | awk '{print $1}'); do
|
NUMPORTS=$((${NUMPORTS} + ${PORTNUM}))
|
||||||
NAME=$(lspci -s "${PCI}" | sed "s/\ .*://" | awk '{$1=""}1' | awk '{$1=$1};1')
|
done
|
||||||
PORT=$(ls -l /sys/class/scsi_host | grep "${PCI}" | awk -F'/' '{print $NF}' | sed 's/host//' | sort -n)
|
[ $(lspci -d ::101 2>/dev/null | wc -l) -gt 0 ] && TEXT+="\n IDE Controller:\n"
|
||||||
PORTNUM=$(lsscsi -b | grep -v - | grep "\[${PORT}:" | wc -l)
|
for PCI in $(lspci -d ::101 2>/dev/null | awk '{print $1}'); do
|
||||||
TEXT+="\Zb ${NAME}\Zn\n Disks: ${PORTNUM}\n"
|
NAME=$(lspci -s "${PCI}" 2>/dev/null | sed "s/\ .*://")
|
||||||
NUMPORTS=$((${NUMPORTS} + ${PORTNUM}))
|
PORTNUM=$(ls -l /sys/block/* 2>/dev/null | grep "${PCI}" | wc -l)
|
||||||
done
|
[ ${PORTNUM} -eq 0 ] && continue
|
||||||
fi
|
TEXT+="\Zb ${NAME}\Zn\nNumber: ${PORTNUM}\n"
|
||||||
if [[ -d "/sys/class/scsi_host" && $(ls -l /sys/class/scsi_host | grep usb | wc -l) -gt 0 ]]; then
|
NUMPORTS=$((${NUMPORTS} + ${PORTNUM}))
|
||||||
TEXT+="\n USB Controller:\n"
|
done
|
||||||
for PCI in $(lspci -d ::c03 | awk '{print $1}'); do
|
[ $(ls -l /sys/class/scsi_host 2>/dev/null | grep usb | wc -l) -gt 0 ] && TEXT+="\n USB Controller:\n"
|
||||||
NAME=$(lspci -s "${PCI}" | sed "s/\ .*://" | awk '{$1=""}1' | awk '{$1=$1};1')
|
for PCI in $(lspci -d ::c03 2>/dev/null | awk '{print $1}'); do
|
||||||
PORT=$(ls -l /sys/class/scsi_host | grep "${PCI}" | awk -F'/' '{print $NF}' | sed 's/host//' | sort -n)
|
NAME=$(lspci -s "${PCI}" 2>/dev/null | sed "s/\ .*://")
|
||||||
PORTNUM=$(lsscsi -b | grep -v - | grep "\[${PORT}:" | wc -l)
|
PORT=$(ls -l /sys/class/scsi_host 2>/dev/null | grep "${PCI}" | awk -F'/' '{print $NF}' | sed 's/host//' | sort -n)
|
||||||
[ ${PORTNUM} -eq 0 ] && continue
|
PORTNUM=$(lsscsi -b 2>/dev/null | grep -v - | grep "\[${PORT}:" | wc -l)
|
||||||
TEXT+="\Zb ${NAME}\Zn\n Disks: ${PORTNUM}\n"
|
[ ${PORTNUM} -eq 0 ] && continue
|
||||||
NUMPORTS=$((${NUMPORTS} + ${PORTNUM}))
|
TEXT+="\Zb ${NAME}\Zn\nNumber: ${PORTNUM}\n"
|
||||||
done
|
NUMPORTS=$((${NUMPORTS} + ${PORTNUM}))
|
||||||
fi
|
done
|
||||||
if [[ -d "/sys/class/mmc_host" && $(ls -l /sys/class/mmc_host | grep mmc_host | wc -l) -gt 0 ]]; then
|
[ $(ls -l /sys/class/mmc_host 2>/dev/null | grep mmc_host | wc -l) -gt 0 ] && TEXT+="\n MMC Controller:\n"
|
||||||
TEXT+="\n MMC Controller:\n"
|
for PCI in $(lspci -d ::805 2>/dev/null | awk '{print $1}'); do
|
||||||
for PCI in $(lspci -d ::805 | awk '{print $1}'); do
|
NAME=$(lspci -s "${PCI}" 2>/dev/null | sed "s/\ .*://")
|
||||||
NAME=$(lspci -s "${PCI}" | sed "s/\ .*://" | awk '{$1=""}1' | awk '{$1=$1};1')
|
PORTNUM=$(ls -l /sys/block/mmc* 2>/dev/null | grep "${PCI}" | wc -l)
|
||||||
PORTNUM=$(ls -l /sys/class/mmc_host | grep "${PCI}" | wc -l)
|
[ ${PORTNUM} -eq 0 ] && continue
|
||||||
PORTNUM=$(ls -l /sys/block/mmc* | grep "${PCI}" | wc -l)
|
TEXT+="\Zb ${NAME}\Zn\nNumber: ${PORTNUM}\n"
|
||||||
[ ${PORTNUM} -eq 0 ] && continue
|
NUMPORTS=$((${NUMPORTS} + ${PORTNUM}))
|
||||||
TEXT+="\Zb ${NAME}\Zn\n Disks: ${PORTNUM}\n"
|
done
|
||||||
NUMPORTS=$((${NUMPORTS} + ${PORTNUM}))
|
[ $(lspci -d ::108 2>/dev/null | wc -l) -gt 0 ] && TEXT+="\n NVME Controller:\n"
|
||||||
done
|
for PCI in $(lspci -d ::108 2>/dev/null | awk '{print $1}'); do
|
||||||
fi
|
NAME=$(lspci -s "${PCI}" 2>/dev/null | sed "s/\ .*://")
|
||||||
if [ $(lspci -d ::108 | wc -l) -gt 0 ]; then
|
PORT=$(ls -l /sys/class/nvme 2>/dev/null | grep "${PCI}" | awk -F'/' '{print $NF}' | sed 's/nvme//' | sort -n)
|
||||||
TEXT+="\n NVMe Controller:\n"
|
PORTNUM=$(lsscsi -b 2>/dev/null | grep -v - | grep "\[N:${PORT}:" | wc -l)
|
||||||
for PCI in $(lspci -d ::108 | awk '{print $1}'); do
|
TEXT+="\Zb ${NAME}\Zn\nNumber: ${PORTNUM}\n"
|
||||||
NAME=$(lspci -s "${PCI}" | sed "s/\ .*://" | awk '{$1=""}1' | awk '{$1=$1};1')
|
NUMPORTS=$((${NUMPORTS} + ${PORTNUM}))
|
||||||
PORT=$(ls -l /sys/class/nvme | grep "${PCI}" | awk -F'/' '{print $NF}' | sed 's/nvme//' | sort -n)
|
done
|
||||||
PORTNUM=$(lsscsi -b | grep -v - | grep "\[N:${PORT}:" | wc -l)
|
if [ $(lsblk -dpno KNAME,SUBSYSTEMS 2>/dev/null | grep 'vmbus:acpi' | wc -l) -gt 0 ]; then
|
||||||
TEXT+="\Zb ${NAME}\Zn\n Disks: ${PORTNUM}\n"
|
TEXT+="\n VMBUS Controller:\n"
|
||||||
NUMPORTS=$((${NUMPORTS} + ${PORTNUM}))
|
NAME="vmbus:acpi"
|
||||||
done
|
PORTNUM=$(lsblk -dpno KNAME,SUBSYSTEMS 2>/dev/null | grep 'vmbus:acpi' | wc -l)
|
||||||
|
TEXT+="\Zb ${NAME}\Zn\nNumber: ${PORTNUM}\n"
|
||||||
|
NUMPORTS=$((${NUMPORTS} + ${PORTNUM}))
|
||||||
fi
|
fi
|
||||||
TEXT+="\n Total Disks: \Zb${NUMPORTS}\Zn"
|
TEXT+="\n Total Disks: \Zb${NUMPORTS}\Zn"
|
||||||
[ -f "${TMP_PATH}/diag" ] && rm -f "${TMP_PATH}/diag" >/dev/null
|
[ -f "${TMP_PATH}/diag" ] && rm -f "${TMP_PATH}/diag" >/dev/null
|
||||||
|
Loading…
Reference in New Issue
Block a user