diff --git a/etc/functions b/etc/functions index d085b24..b74bd35 100644 --- a/etc/functions +++ b/etc/functions @@ -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 }