From 5379e567cd1c1e7c7ffa6f881a05e183831b488e Mon Sep 17 00:00:00 2001 From: Petr Sabata Date: Wed, 18 May 2011 19:13:31 +0200 Subject: [PATCH] dm-crypt-start.sh shouldn't contain bashisms All shell scripts should be POSIX compatible, not depending on a specific shell implementation without explicitly stating so. This patch changes the fixes C-style for loop to a while equivalent. Signed-off-by: Petr Sabata --- dm-crypt-start.sh | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/dm-crypt-start.sh b/dm-crypt-start.sh index c78f0bc..38c4b20 100644 --- a/dm-crypt-start.sh +++ b/dm-crypt-start.sh @@ -150,13 +150,14 @@ dm_crypt_execute_dmcrypt() { : ${gpg_options:='-q -d'} # gpg available ? if type -p gpg >/dev/null ; then - for (( i = 0 ; i < 3 ; i++ )) + i=0; while [ $i -lt 3 ] do # paranoid, don't store key in a variable, pipe it so it stays very little in ram unprotected. # save stdin stdout stderr "values" gpg ${gpg_options} ${key} 2>/dev/null | cryptsetup ${options} ${arg1} ${arg2} ${arg3} ret="$?" [ "$ret" -eq 0 ] && break + i=$(($i+1)) done eend "${ret}" "failure running cryptsetup" else -- 1.7.5.rc3