Update output of check script

This commit is contained in:
2023-06-21 12:07:41 +02:00
parent 13d078be75
commit a82034f245
+14 -2
View File
@@ -47,10 +47,22 @@ CheckIQN() {
MOUNTPOINT=$(grep "${BLOCKDEVICE}" /proc/mounts | head -n 1 | cut -d " " -f 2) MOUNTPOINT=$(grep "${BLOCKDEVICE}" /proc/mounts | head -n 1 | cut -d " " -f 2)
echo -n "${IQN}: "
RETURNCODE=0
if [[ -z "${MOUNTPOINT}" || ! -d "${MOUNTPOINT}" ]]; then if [[ -z "${MOUNTPOINT}" || ! -d "${MOUNTPOINT}" ]]; then
fsck -f ${BLOCKDEVICE} fsck -f ${BLOCKDEVICE} &> /dev/null
RETURNCODE=$?
else else
fsck -nf ${BLOCKDEVICE} fsck -nf ${BLOCKDEVICE} &> /dev/null
RETURNCODE=$?
fi
if [ "${RETURNCODE}" -ne "0" ]; then
echo "ERROR"
echo " ${BLOCKDEVICE} contains errors, please check the filesystem"
else
echo "OK"
fi fi
} }