diff --git a/wizard.sh b/wizard.sh index 6e215365f..57311d40c 100755 --- a/wizard.sh +++ b/wizard.sh @@ -262,20 +262,26 @@ install_collection() { fi done + local YES="" + if [[ ${SILENT} == "false" ]]; then COLLECTION_TO_INSTALL=($(whiptail --separate-output --ok-button Continue --title "Crowdsec collections" --checklist "Available collections in crowdsec, try to pick one that fits your profile. Collections contains parsers and scenarios to protect your system." 20 120 10 "${HMENU[@]}" 3>&1 1>&2 2>&3)) if [ $? -eq 1 ]; then log_err "user bailed out at collection selection" exit 1; fi; + else + YES="--yes" fi; for collection in "${COLLECTION_TO_INSTALL[@]}"; do log_info "Installing collection '${collection}'" - ${CSCLI_BIN_INSTALLED} collections install "${collection}" --error + # shellcheck disable=SC2248 + ${CSCLI_BIN_INSTALLED} collections install "${collection}" --error ${YES} done - ${CSCLI_BIN_INSTALLED} parsers install "crowdsecurity/whitelists" --error + # shellcheck disable=SC2248 + ${CSCLI_BIN_INSTALLED} parsers install "crowdsecurity/whitelists" --error ${YES} if [[ ${SILENT} == "false" ]]; then whiptail --msgbox "Out of safety, I installed a parser called 'crowdsecurity/whitelists'. This one will prevent private IP addresses from being banned, feel free to remove it any time." 20 50 fi