mirror of
https://github.com/Spearfoot/FreeNAS-scripts
synced 2025-12-16 16:23:33 +00:00
Consistent if and do code formatting
This commit is contained in:
@@ -37,8 +37,7 @@ get_smart_drives()
|
|||||||
|
|
||||||
gs_smartdrives=""
|
gs_smartdrives=""
|
||||||
|
|
||||||
for gs_drive in $gs_drives
|
for gs_drive in $gs_drives; do
|
||||||
do
|
|
||||||
gs_smart_flag=$(/usr/local/sbin/smartctl -i /dev/"$gs_drive" | grep "SMART support is: Enabled" | awk '{print $4}')
|
gs_smart_flag=$(/usr/local/sbin/smartctl -i /dev/"$gs_drive" | grep "SMART support is: Enabled" | awk '{print $4}')
|
||||||
if [ "$gs_smart_flag" == "Enabled" ]; then
|
if [ "$gs_smart_flag" == "Enabled" ]; then
|
||||||
gs_smartdrives=$gs_smartdrives" "${gs_drive}
|
gs_smartdrives=$gs_smartdrives" "${gs_drive}
|
||||||
@@ -76,8 +75,7 @@ echo "<pre style=\"font-size:14px\">" >> ${logfile}
|
|||||||
echo "+------+------------------+----+-----+-----+-----+-------+-------+--------+------+----------+------+-------+"
|
echo "+------+------------------+----+-----+-----+-----+-------+-------+--------+------+----------+------+-------+"
|
||||||
) >> ${logfile}
|
) >> ${logfile}
|
||||||
|
|
||||||
for drive in $drives
|
for drive in $drives; do
|
||||||
do
|
|
||||||
(
|
(
|
||||||
/usr/local/sbin/smartctl -A -i -v 7,hex48 /dev/"${drive}" | \
|
/usr/local/sbin/smartctl -A -i -v 7,hex48 /dev/"${drive}" | \
|
||||||
awk -v device="${drive}" -v tempWarn=${tempWarn} -v tempCrit=${tempCrit} -v sectorsCrit=${sectorsCrit} \
|
awk -v device="${drive}" -v tempWarn=${tempWarn} -v tempCrit=${tempCrit} -v sectorsCrit=${sectorsCrit} \
|
||||||
@@ -118,11 +116,9 @@ for drive in $drives
|
|||||||
) >> ${logfile}
|
) >> ${logfile}
|
||||||
|
|
||||||
###### for each drive ######
|
###### for each drive ######
|
||||||
for drive in $drives
|
for drive in $drives; do
|
||||||
do
|
|
||||||
brand=$(/usr/local/sbin/smartctl -i /dev/"${drive}" | grep "Model Family" | awk '{print $3, $4, $5}')
|
brand=$(/usr/local/sbin/smartctl -i /dev/"${drive}" | grep "Model Family" | awk '{print $3, $4, $5}')
|
||||||
if [ -z "$brand" ];
|
if [ -z "$brand" ]; then
|
||||||
then
|
|
||||||
brand=$(/usr/local/sbin/smartctl -i /dev/"${drive}" | grep "Device Model" | awk '{print $3, $4, $5}')
|
brand=$(/usr/local/sbin/smartctl -i /dev/"${drive}" | grep "Device Model" | awk '{print $3, $4, $5}')
|
||||||
fi
|
fi
|
||||||
serial=$(/usr/local/sbin/smartctl -i /dev/"${drive}" | grep "Serial Number" | awk '{print $3}')
|
serial=$(/usr/local/sbin/smartctl -i /dev/"${drive}" | grep "Serial Number" | awk '{print $3}')
|
||||||
|
|||||||
Reference in New Issue
Block a user