2021-03-11 14:04:04 +01:00
|
|
|
#!/bin/bash
|
|
|
|
dir="/tmp/installer"
|
2021-05-09 21:52:18 +02:00
|
|
|
step="${dir}/step"
|
2021-03-11 14:04:04 +01:00
|
|
|
wrksrc="${dir}"/tmp
|
|
|
|
functions="${dir}/functions"
|
2021-04-15 10:52:35 +02:00
|
|
|
FILESDIR="${dir}/files"
|
2021-04-15 10:43:20 +02:00
|
|
|
|
2021-03-11 14:04:04 +01:00
|
|
|
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
|
|
|
|
2021-03-17 00:06:12 +01:00
|
|
|
input=( "${@}" )
|
2021-03-16 23:58:43 +01:00
|
|
|
max="${#input[@]}"
|
2021-03-17 00:13:37 +01:00
|
|
|
for i in $(seq 0 "$(( max - 1 ))"); do
|
2021-03-17 00:10:21 +01:00
|
|
|
if [[ "${i}" == "0" ]]; then
|
2021-03-16 23:58:43 +01:00
|
|
|
cfg+=( [diskpw]="${input[$i]}" )
|
2021-03-16 22:46:00 +01:00
|
|
|
else
|
2021-03-16 23:13:10 +01:00
|
|
|
users+=( [pw$i]="${input[$i]}" )
|
2021-03-16 22:46:00 +01:00
|
|
|
fi
|
2021-03-16 22:38:22 +01:00
|
|
|
done
|
2021-03-16 20:17:51 +01:00
|
|
|
|
|
|
|
export run="install"
|
2021-05-09 21:52:18 +02:00
|
|
|
for i in $(find "${step}3" -mindepth 1 -maxdepth 1 -type f | sort -n ); do
|
2021-05-09 22:10:27 +02:00
|
|
|
test -f "${i}" && source "${i}"
|
2021-03-16 20:17:51 +01:00
|
|
|
done
|
|
|
|
|
2021-03-11 14:04:04 +01:00
|
|
|
export run="post"
|
2021-05-09 22:10:27 +02:00
|
|
|
for i in $(find "${step}4" -mindepth 1 -maxdepth 1 -type f | sort -n); do
|
2021-05-09 20:58:18 +02:00
|
|
|
test -f "${i}" && source "${i}"
|
2021-03-16 20:17:51 +01:00
|
|
|
done
|