38 lines
747 B
Bash
Executable File
38 lines
747 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
|
|
test -f "${i}" && source "${i}"
|
|
done
|
|
|
|
export run="post"
|
|
for i in $(find "${step}4" -mindepth 1 -maxdepth 1 -type f | sort -n); do
|
|
test -f "${i}" && source "${i}"
|
|
done
|