From be1c7e50e1e8809ea56f2c9d472eccd8ffd73a97 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 04:57:58 +0200 Subject: Adding upstream version 1.44.3. Signed-off-by: Daniel Baumann --- fluent-bit/install.sh | 119 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100755 fluent-bit/install.sh (limited to 'fluent-bit/install.sh') diff --git a/fluent-bit/install.sh b/fluent-bit/install.sh new file mode 100755 index 00000000..d5bacd95 --- /dev/null +++ b/fluent-bit/install.sh @@ -0,0 +1,119 @@ +#!/usr/bin/env bash +set -e + +# Provided primarily to simplify testing for staging, etc. +RELEASE_URL=${FLUENT_BIT_PACKAGES_URL:-https://packages.fluentbit.io} +RELEASE_KEY=${FLUENT_BIT_PACKAGES_KEY:-$RELEASE_URL/fluentbit.key} + +# Optionally specify the version to install +RELEASE_VERSION=${FLUENT_BIT_RELEASE_VERSION:-} +# Optionally prefix install commands, e.g. use 'echo ' here to prevent installation after repo set up. +INSTALL_CMD_PREFIX=${FLUENT_BIT_INSTALL_COMMAND_PREFIX:-} +# Optionally set the name of th package to install, e.g. for legacy td-agent-bit. +INSTALL_PACKAGE_NAME=${FLUENT_BIT_INSTALL_PACKAGE_NAME:-fluent-bit} +# Optional Apt/Yum additional parameters (e.g. releasever for AL2022/AL2023) +APT_PARAMETERS=${FLUENT_BIT_INSTALL_APT_PARAMETERS:-} +YUM_PARAMETERS=${FLUENT_BIT_INSTALL_YUM_PARAMETERS:-} + +echo "================================" +echo " Fluent Bit Installation Script " +echo "================================" +echo "This script requires superuser access to install packages." +echo "You will be prompted for your password by sudo." + +# Determine package type to install: https://unix.stackexchange.com/a/6348 +# OS used by all - for Debs it must be Ubuntu or Debian +# CODENAME only used for Debs +if [ -f /etc/os-release ]; then + # Debian uses Dash which does not support source + # shellcheck source=/dev/null + . /etc/os-release + OS=$( echo "${ID}" | tr '[:upper:]' '[:lower:]') + CODENAME=$( echo "${VERSION_CODENAME}" | tr '[:upper:]' '[:lower:]') +elif lsb_release &>/dev/null; then + OS=$(lsb_release -is | tr '[:upper:]' '[:lower:]') + CODENAME=$(lsb_release -cs) +else + OS=$(uname -s) +fi + +SUDO=sudo +if [ "$(id -u)" -eq 0 ]; then + SUDO='' +else + # Clear any previous sudo permission + sudo -k +fi + +# Set up version pinning +APT_VERSION='' +YUM_VERSION='' +if [ -n "${RELEASE_VERSION}" ]; then + APT_VERSION="=$RELEASE_VERSION" + YUM_VERSION="-$RELEASE_VERSION" +fi + +# Now set up repos and install dependent on OS, version, etc. +# Will require sudo +case ${OS} in + amzn|amazonlinux) + $SUDO sh <