WIP #19: Detect duplicate LABEL entries

This commit is contained in:
Benoît S. 2018-03-09 18:05:09 +01:00
parent b8deaf2f5d
commit 36822bf383

View file

@ -99,6 +99,7 @@ IS_MONGO_BACKUP=1
IS_MOUNT_FSTAB=1
IS_NETWORK_INTERFACES=1
IS_EVOBACKUP=1
IS_DUPLICATE_FS_LABEL=1
#Proper to OpenBSD
IS_SOFTDEP=1
@ -725,6 +726,17 @@ if [ -e /etc/debian_version ]; then
&& test -f /etc/squid/evolinux-custom.conf) || echo 'IS_SQUIDEVOLINUXCONF FAILED!'
fi
fi
if [ "IS_DUPLICATE_FS_LABEL" = 1 ]; then
# Only on systems that have lsblk
if [ -x "$(which lsblk)" ]; then
tmpFile=$(mktemp -p /tmp)
for part in $(lsblk -n -o LABEL); do
echo $part >> $tmpFile
done
sort < $tmpFile | uniq -d
fi
fi
fi