void-bash-installer/run_in_chroot.sh

40 lines
871 B
Bash
Raw Normal View History

2021-03-11 14:04:04 +01:00
#!/bin/bash
dir="/tmp/installer"
wrksrc="${dir}"/tmp
functions="${dir}/functions"
modules="${dir}/modules"
config_mods="${modules}/config"
install_mods="${modules}/install"
chroot_mods="${modules}/chroot"
vars="${wrksrc}/vars"
declare -A cfg=()
declare -A users=()
#set -x
source "${functions}"/functions
2021-03-16 20:17:51 +01:00
for i in $(find "${vars}" -type f); do
source "${i}"
done
2021-03-16 22:38:22 +01:00
cfg+=( [diskpw]="${1}" )
input="${@}"
for i in $(seq 1 "${#input[@]}"); do
2021-03-16 22:46:00 +01:00
if [[ "${i}" == "1" ]]; then
cfg+=( [diskpw]="${1}" )
else
c="$(( i - 1 ))"
users+=( [pw$c]="${input[$c]}" )
fi
2021-03-16 22:38:22 +01:00
done
2021-03-16 20:17:51 +01:00
export run="install"
for i in $(find "${modules}" -mindepth 1 -maxdepth 1 -type d | sort -n ); do
test -f "${i}"/install && source "${i}"/install
done
2021-03-11 14:04:04 +01:00
export run="post"
for i in $(find "${modules}" -mindepth 1 -maxdepth 1 -type d | sort -n); do
test -f "${i}"/post && source "${i}"/post
2021-03-16 20:17:51 +01:00
done