From c1055b68263e5f1b79d7b92ad79d375e224ef076 Mon Sep 17 00:00:00 2001 From: Tom Gundersen Date: Tue, 17 Jul 2012 16:36:47 +0200 Subject: cryptsetup: negate a wrong check blkid returns 2 when nothing is found on the device, which is exactly when we want to use it. Signed-off-by: Tom Gundersen --- functions | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'functions') diff --git a/functions b/functions index 3798b79..794766c 100644 --- a/functions +++ b/functions @@ -462,13 +462,13 @@ do_unlock_systemd() { if IFS=, in_array swap ${options[@]}; then # create swap on the device only if no fs signature exists blkid -p "$2" &>/dev/null - if (( $? == 2 )) || ! mkswap /dev/mapper/$name >/dev/null; then + if (( $? != 2 )) || ! mkswap /dev/mapper/$name >/dev/null; then failed=1 fi elif IFS=, in_array tmp ${options[@]}; then # create fs on the device only if no fs signature exists blkid -p "$2" &>/dev/null - if (( $? == 2 )) || ! mke2fs /dev/mapper/$name >/dev/null; then + if (( $? != 2 )) || ! mke2fs /dev/mapper/$name >/dev/null; then failed=1 fi fi -- cgit v1.2.3