Sfoglia il codice sorgente

Update output of check script

JDierkse 2 anni fa
parent
commit
a82034f245
1 ha cambiato i file con 14 aggiunte e 2 eliminazioni
  1. 14 2
      check

+ 14 - 2
check

@@ -47,10 +47,22 @@ CheckIQN() {
 
 	MOUNTPOINT=$(grep "${BLOCKDEVICE}" /proc/mounts | head -n 1 | cut -d " " -f 2)
 
+	echo -n "${IQN}: "
+
+	RETURNCODE=0
 	if [[ -z "${MOUNTPOINT}" || ! -d "${MOUNTPOINT}" ]]; then
-		fsck -f ${BLOCKDEVICE}
+		fsck -f ${BLOCKDEVICE} &> /dev/null
+		RETURNCODE=$?
+	else
+		fsck -nf ${BLOCKDEVICE} &> /dev/null
+		RETURNCODE=$?
+	fi
+
+	if [ "${RETURNCODE}" -ne "0" ]; then
+		echo "ERROR"
+		echo "  ${BLOCKDEVICE} contains errors, please check the filesystem"
 	else
-		fsck -nf ${BLOCKDEVICE}
+		echo "OK"
 	fi
 }