1
0
mirror of https://github.com/byReqz/stocheck.git synced 2024-12-26 10:51:48 +00:00

added drive counting

This commit is contained in:
Nils 2021-02-10 12:07:46 +00:00 committed by GitHub
parent 2777e4e7ba
commit 3617e88338
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,6 +13,9 @@ while [ -z "$1" ]; do
if [[ -z "$raidcheck" ]];then
if [[ -n $(ls /sys/block | grep sd) ]];then
echo "=== sata drive check: ==="
echo "-------------------------"
echo "$(ls -l /sys/block | grep sd | wc -l) Drives found"
echo "-------------------------"
for x in {a..z};do
scan=$(smartctl --scan)
if [[ -n $(echo $scan | grep /dev/sd$x) ]];then
@ -34,6 +37,9 @@ while [ -z "$1" ]; do
fi
if [[ -n $(ls /dev | grep nvme) ]];then
echo "=== nvme drive check: ==="
echo "-------------------------"
echo "$(ls -l /dev | grep nvme | wc -l) Drives found"
echo "-------------------------"
for x in {0..4};do
scan=$(smartctl --scan)
if [[ -n $(echo $scan | grep /dev/nvme$x) ]];then