From e55f19982997ecae36a3df0a1cf6a5382e48ca4a Mon Sep 17 00:00:00 2001 From: "T. R. Bernstein" <137705289+trbernstein@users.noreply.github.com> Date: Fri, 28 Jun 2024 15:40:46 +0200 Subject: [PATCH] Add noninteractive arg to install.sh --- install.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/install.sh b/install.sh index b325a9e..7e130d0 100755 --- a/install.sh +++ b/install.sh @@ -61,6 +61,7 @@ function installModules() { filterPasswordOptions [[ "${verbose}" == true ]] && moduleOptions+=(-v) [[ -n ${logfile} ]] && moduleOptions+=(-d ${logfile}) + [[ -n ${noninteractive} ]] && moduleOptions+=(--noninteractive) lop -- -d "Running ${mod}" -d "with ${#moduleOptions} args:" -d "${filteredOptions}" runModule ${mod} ${moduleOptions} done @@ -114,6 +115,8 @@ function main() { -l, --list List modules that are going to be installed and exit without installation. Modules are printed in minimal but still distinct paths. + --noninteractive Run the installation noninteractively. In this case + a config file must be provided. -d FILE, --logfile FILE Print log message to logfile instead of stdout. -v, --verbose Be more verbose. --config-only PATH Ask module questions, generate config at PATH and @@ -130,6 +133,8 @@ function main() { lop -- -d "Current working dir is: `pwd`" lop -- -d "Called main with $# args: $*" + [[ -n ${noninteractive} && -z ${config} ]] && { lop -- -e 'A config file must be provided in noninteractive mode.'; return 10 } + modpath+=("${_DIR}/modules") loadModules -v modulesToInstall ${$(echo -m):^^modpath} "${module[@]}" [ "${list}" = true ] && printModulesToInstall