mirror of
https://github.com/byReqz/stocheck.git
synced 2024-11-14 11:43:15 +00:00
add help
This commit is contained in:
parent
65ab4d167b
commit
123d2fe2ff
17
stocheck.sh
17
stocheck.sh
@ -11,19 +11,22 @@ while [ ! -n "$1" ]; do
|
|||||||
if [[ -n $(ls /sys/block | grep sd) ]];then
|
if [[ -n $(ls /sys/block | grep sd) ]];then
|
||||||
echo "=== sata drive check: ==="
|
echo "=== sata drive check: ==="
|
||||||
for x in {a..z};do
|
for x in {a..z};do
|
||||||
if [[ -n $(smartctl --scan | grep /dev/sd$x) ]];then
|
scan=$(smartctl --scan)
|
||||||
|
if [[ -n $(echo $scan | grep /dev/sd$x) ]];then
|
||||||
echo "------------------- /dev/sd$x --------------------";
|
echo "------------------- /dev/sd$x --------------------";
|
||||||
smartctl -H -i /dev/sd$x;
|
smartctl -H -i /dev/sd$x;
|
||||||
echo "-----------------------------------------------------";
|
echo "-------------------------------------------------";
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
if [[ -n $(ls /dev | grep nvme) ]];then
|
if [[ -n $(ls /dev | grep nvme) ]];then
|
||||||
echo "=== nvme drive check: ==="
|
echo "=== nvme drive check: ==="
|
||||||
for x in {0..4};do
|
for x in {0..4};do
|
||||||
|
scan=$(smartctl --scan)
|
||||||
|
if [[ -n $(echo $scan | grep /dev/nvme$x) ]];then
|
||||||
echo "------------------- /dev/nvme$x --------------------";
|
echo "------------------- /dev/nvme$x --------------------";
|
||||||
smartctl -H -i /dev/nvme$x;
|
smartctl -H -i /dev/nvme$x;
|
||||||
echo "---------------------------------------------------------";
|
echo "---------------------------------------------------";
|
||||||
exit
|
fi
|
||||||
done
|
done
|
||||||
else
|
else
|
||||||
exit
|
exit
|
||||||
@ -44,5 +47,11 @@ while [ ! -z "$1" ]; do
|
|||||||
echo "#############################################"
|
echo "#############################################"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
elif [[ "$1" == "--help" ]] || [[ "$1" == "-h" ]];then
|
||||||
|
echo "Usage: $0 (options) <ip> (y/n)"
|
||||||
|
echo "Options:"
|
||||||
|
echo " -u/--update -- update the script"
|
||||||
|
echo " -h/--help -- show help"
|
||||||
|
exit
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
Loading…
Reference in New Issue
Block a user