This commit is contained in:
teldra 2022-02-09 10:13:59 +01:00
parent 26d0611b6c
commit b436b4a642

View File

@ -121,21 +121,28 @@ yesno() {
readin() {
WHICH="$1"
header "$WHICH"
local -a choice
for i in $(find ./etc/${WHICH}/ -type f | sort); do
choice+=("$(basename $i)")
done
if [ "${#choice[@]}" -gt "1" ]; then
header "$WHICH"
multiplechoice "${choice[@]}"
elif [ "${#choice[@]}" -eq "1" ]; then
output=${choice[0]}
fi
if ! [ "${#choice[@]}" -eq "0" ]; then
. ./etc/${WHICH}/$output
packages
reset packages
cp ./etc/${WHICH}/$output $tmp_target
if [ -s ./etc/${WHICH}/$output ]; then
if grep -q "packages()" ./etc/${WHICH}/$output; then
. ./etc/${WHICH}/$output
packages
reset packages
fi
if grep -q "config()" ./etc/${WHICH}/$output; then
cp ./etc/${WHICH}/$output $tmp_target
fi
fi
fi
}