void-bash-installer/run_in_chroot.sh
2021-05-09 22:10:27 +02:00

40 lines
765 B
Bash
Executable File

#!/bin/bash
dir="/tmp/installer"
step="${dir}/step"
wrksrc="${dir}"/tmp
functions="${dir}/functions"
FILESDIR="${dir}/files"
vars="${wrksrc}/vars"
declare -A cfg=()
declare -A users=()
#set -x
source "${functions}"/functions
for i in $(find "${vars}" -type f); do
source "${i}"
done
input=( "${@}" )
max="${#input[@]}"
for i in $(seq 0 "$(( max - 1 ))"); do
if [[ "${i}" == "0" ]]; then
cfg+=( [diskpw]="${input[$i]}" )
else
users+=( [pw$i]="${input[$i]}" )
fi
done
export run="install"
for i in $(find "${step}3" -mindepth 1 -maxdepth 1 -type f | sort -n ); do
echo $i
test -f "${i}" && source "${i}"
done
export run="post"
for i in $(find "${step}4" -mindepth 1 -maxdepth 1 -type f | sort -n); do
echo $i
test -f "${i}" && source "${i}"
done