Fixed typo when searching for swap partition

This commit is contained in:
mboelen 2014-09-04 20:38:57 +02:00
parent b121be4317
commit 7af9a9e88c
1 changed files with 13 additions and 2 deletions

View File

@ -191,7 +191,18 @@
for I in ${FIND}; do
FOUND=1
logtext "Swap partition found: ${I}"
# YYY add test if partition is not a normal partition (e.g. UUID=)
# YYY Add a test if partition is not a normal partition (e.g. UUID=)
# Can be ^/dev/mapper/vg-name_lv-name
# Can be ^/dev/partition
# Can be ^UUID=uuid --> /dev/disk/by-uuid/<uuid>
# if [ ! "${BLKIDBINARY}" = "" ]; then
# FIND2=`${BLKIDBINARY} | awk '{ if ($2=="UUID=\"${UUID}\"") print $1 }' | sed 's/:$//'`
# else
# logtext "Result: blkid binary not found, trying by checking device listing"
# if [ -f /dev/disk/by-uuid/${UUID} ]; then
# logtext "Result: found disk via /dev/disk/by-uuid listing"
# fi
# fi
report "swap_partition[]=${I}"
done
if [ ${FOUND} -eq 1 ]; then
@ -212,7 +223,7 @@
if [ ${SKIPTEST} -eq 0 ]; then
# Swap partitions should be mounted with 'sw' or 'swap'
logtext "Test: check swap partitions with incorrect mount options"
FIND=`awk '{ if ($3=="swap" && ($4!="sw" && $4!="swap")) print $1 }' /etc/fstab`
FIND=`awk '{ if ($3=="swap" && ($4!="sw" && $4!="swap" $4!="defaults")) print $1 }' /etc/fstab`
if [ "${FIND}" = "" ]; then
Display --indent 2 --text "- Testing swap partitions..." --result OK --color GREEN
logtext "Result: all swap partitions have correct options (sw or swap)"