44 lines
977 B
Bash
Executable File
44 lines
977 B
Bash
Executable File
#!/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
|
|
|
|
for i in $(find "${vars}" -type f); do
|
|
source "${i}"
|
|
done
|
|
|
|
input="${@}"
|
|
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
|
|
echo diskp "${input[$i]}"
|
|
cfg+=( [diskpw]="${input[$i]}" )
|
|
else
|
|
echo user "${input[$i]}"
|
|
users+=( [pw$i]="${input[$i]}" )
|
|
fi
|
|
done
|
|
|
|
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
|
|
|
|
export run="post"
|
|
for i in $(find "${modules}" -mindepth 1 -maxdepth 1 -type d | sort -n); do
|
|
test -f "${i}"/post && source "${i}"/post
|
|
done
|