From 28e36c318a6ac79f0a2cb599bc7988cf1243d356 Mon Sep 17 00:00:00 2001 From: teldra Date: Wed, 17 Mar 2021 00:10:21 +0100 Subject: [PATCH] small fixes --- main.sh | 2 +- run_in_chroot.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/main.sh b/main.sh index ef3de1e..0f563b5 100755 --- a/main.sh +++ b/main.sh @@ -42,6 +42,6 @@ for i in $(seq 1 "${users[amount]}"); do pw+=( "${users[pw$i]}" ) done -chroot "${dest}" "/tmp/installer/run_in_chroot.sh" "${pw[@]}" "${cfg[diskpw]}" +chroot "${dest}" "/tmp/installer/run_in_chroot.sh" "${cfg[diskpw]}" "${pw[@]}" umounter "${dest}" diff --git a/run_in_chroot.sh b/run_in_chroot.sh index 2f3ad5d..77991dd 100755 --- a/run_in_chroot.sh +++ b/run_in_chroot.sh @@ -22,8 +22,8 @@ max="${#input[@]}" echo 0 "${input[0]}" echo 1 "${input[1]}" echo 2 "${input[2]}" -for i in $(seq 1 "${max}"); do - if [[ "${i}" == "${#input[@]}" ]]; then +for i in $(seq 0 "${max}"); do + if [[ "${i}" == "0" ]]; then echo diskp "${input[$i]}" cfg+=( [diskpw]="${input[$i]}" ) else