diff --git a/run_in_chroot.sh b/run_in_chroot.sh index c82b5d9..4b52a12 100755 --- a/run_in_chroot.sh +++ b/run_in_chroot.sh @@ -19,11 +19,10 @@ done input="${@}" for i in $(seq 1 "${#input[@]}"); do - if [[ "${i}" == "1" ]]; then + if [[ "${i}" == "${#input[@]}" ]]; then cfg+=( [diskpw]="${1}" ) else - c="$(( i - 1 ))" - users+=( [pw$c]="${input[$c]}" ) + users+=( [pw$i]="${input[$i]}" ) fi done