fix ignore suspended checks
This commit is contained in:
parent
c4ee6d3fc6
commit
074a9d61c6
@ -99,11 +99,11 @@
|
|||||||
do
|
do
|
||||||
# check if the disk is used and not suspended
|
# check if the disk is used and not suspended
|
||||||
dev=$(basename $disk)
|
dev=$(basename $disk)
|
||||||
[ -f ${g_tmp}/${dev}-stat ] || cat /sys/block/${dev}/stat | perl -pe 's/ +/ /g' | cut -d" " -f1,2,3,4,5,6,7,8 > ${g_tmp}/${dev}-stat
|
[ -f /tmp/${dev}-stat ] || cat /sys/block/${dev}/stat | perl -pe 's/ +/ /g' | cut -d" " -f1,2,3,4,5,6,7,8 > /tmp/${dev}-stat
|
||||||
cat /sys/block/${dev}/stat | perl -pe 's/ +/ /g' | cut -d" " -f1,2,3,4,5,6,7,8 > ${g_tmp}/${dev}-stat-now
|
cat /sys/block/${dev}/stat | perl -pe 's/ +/ /g' | cut -d" " -f1,2,3,4,5,6,7,8 > /tmp/${dev}-stat-now
|
||||||
if diff ${g_tmp}/${dev}-stat-now ${g_tmp}/${dev}-stat >/dev/null 2>&1
|
if diff /tmp/${dev}-stat-now /tmp/${dev}-stat >/dev/null 2>&1
|
||||||
then
|
then
|
||||||
cat ${g_tmp}/${dev}-stat-now >${g_tmp}/${dev}-stat
|
cat /tmp/${dev}-stat-now >/tmp/${dev}-stat
|
||||||
# Check disk SMART
|
# Check disk SMART
|
||||||
OPT=""
|
OPT=""
|
||||||
udevadm info --query=all -n $disk | grep -q usb- && OPT="-d sat"
|
udevadm info --query=all -n $disk | grep -q usb- && OPT="-d sat"
|
||||||
|
Loading…
Reference in New Issue
Block a user