1
0
mirror of https://github.com/byReqz/stocheck.git synced 2024-11-25 15:34:54 +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 [[ -z "$raidcheck" ]];then
if [[ -n $(ls /sys/block | grep sd) ]];then if [[ -n $(ls /sys/block | grep sd) ]];then
echo "=== sata drive check: ===" echo "=== sata drive check: ==="
echo "-------------------------"
echo "$(ls -l /sys/block | grep sd | wc -l) Drives found"
echo "-------------------------"
for x in {a..z};do for x in {a..z};do
scan=$(smartctl --scan) scan=$(smartctl --scan)
if [[ -n $(echo $scan | grep /dev/sd$x) ]];then if [[ -n $(echo $scan | grep /dev/sd$x) ]];then
@ -34,6 +37,9 @@ while [ -z "$1" ]; do
fi fi
if [[ -n $(ls /dev | grep nvme) ]];then if [[ -n $(ls /dev | grep nvme) ]];then
echo "=== nvme drive check: ===" echo "=== nvme drive check: ==="
echo "-------------------------"
echo "$(ls -l /dev | grep nvme | wc -l) Drives found"
echo "-------------------------"
for x in {0..4};do for x in {0..4};do
scan=$(smartctl --scan) scan=$(smartctl --scan)
if [[ -n $(echo $scan | grep /dev/nvme$x) ]];then if [[ -n $(echo $scan | grep /dev/nvme$x) ]];then