diff options
-rw-r--r-- | functions | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -473,18 +473,19 @@ do_unlock_legacy() { } do_unlock_systemd() { - local failed=0 + local name=$1 device=$2 password=$3 options=$4 failed=0 - if ! /usr/lib/systemd/systemd-cryptsetup attach "$1" "$2" "$3" $4; then + if ! /usr/lib/systemd/systemd-cryptsetup attach "$name" "$device" "$password" $options; then failed=1 else - if IFS=, in_array swap ${options[@]}; then + options=${options//,/ } + if 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 failed=1 fi - elif IFS=, in_array tmp ${options[@]}; then + elif 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 |