add a warning/error if the user is trying to run wizard from source (yes that's you) (#337)

This commit is contained in:
Thibault "bui" Koechlin 2020-10-28 17:23:05 +01:00 committed by GitHub
parent 2fdf7624da
commit 62cbf99dbb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -288,6 +288,14 @@ install_plugins_bin() {
#install crowdsec and cscli
install_crowdsec() {
if [[ ! -f "$CROWDSEC_BIN" ]]; then
log_err "Crowdsec binary '$CROWDSEC_BIN' not found, you have likely clone the repository."
log_err "If you are trying to install crowdsec, please download a release :"
log_err "https://github.com/crowdsecurity/crowdsec/releases/latest"
exit
fi
mkdir -p "${CROWDSEC_DATA_DIR}"
(cd config && find patterns -type f -exec install -Dm 644 "{}" "${CROWDSEC_CONFIG_PATH}/{}" \; && cd ../) || exit
mkdir -p "${CROWDSEC_CONFIG_PATH}/scenarios" || exit
@ -325,10 +333,10 @@ update_bins() {
update_full() {
if [[ ! -f "$CROWDSEC_BIN" ]]; then
log_err "Crowdwatch binary '$CROWDSEC_BIN' not found. Please build it with 'make build'" && exit
log_err "Crowdsec binary '$CROWDSEC_BIN' not found. Please build it with 'make build'" && exit
fi
if [[ ! -f "$CSCLI_BIN" ]]; then
log_err "Cwcli binary '$CSCLI_BIN' not found. Please build it with 'make build'" && exit
log_err "Cscli binary '$CSCLI_BIN' not found. Please build it with 'make build'" && exit
fi
log_info "Backing up existing configuration"