Created
March 16, 2023 11:46
-
-
Save LaurenceJJones/05ffcb9be3e4a6a005647f41198f6aa6 to your computer and use it in GitHub Desktop.
Install from crowdsec gt repo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CROWDSEC_GITHUB_RELEASE="github.com/crowdsecurity/crowdsec/releases/download" | |
CROWDSEC_VERSION="1.4.6" | |
CROWDSEC_FILE="crowdsec-release-static.tgz" | |
OLD_DIR=$(pwd) | |
TMP_DIR=$(mktemp -d) | |
download() { | |
if command -v curl >/dev/null; then | |
cd "$2" || (echo "Could not cd to $2" && exit 1) | |
# older versions of curl don't support --output-dir | |
curl -sSLO --fail --remote-name "$1" | |
cd - >/dev/null | |
elif command -v wget >/dev/null; then | |
wget -nv -P "$2" "$1" | |
else | |
echo "Neither curl nor wget is available, cannot download files." | |
exit 1 | |
fi | |
} | |
download "$CROWDSEC_GITHUB_RELEASE/v$CROWDSEC_VERSION/$CROWDSEC_FILE" "$TMP_DIR" | |
tar -xzf "$TMP_DIR/$CROWDSEC_FILE" -C "$TMP_DIR" | |
cd "$TMP_DIR/crowdsec-v$CROWDSEC_VERSION" | |
./wizard.sh --install | |
cd "$OLD_DIR" | |
rm -rf "$TMP_DIR" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment