summaryrefslogtreecommitdiffstats
path: root/packaging/installer/dependencies/clearlinux.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-02-15 03:25:22 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-02-15 03:25:22 +0000
commit0ce692f2add209c6f5d449ee2be7af725f1813e8 (patch)
tree2af915c6ff875c3b0b4367c334032726d2d6839a /packaging/installer/dependencies/clearlinux.sh
parentAdding upstream version 1.33.0. (diff)
downloadnetdata-0ce692f2add209c6f5d449ee2be7af725f1813e8.tar.xz
netdata-0ce692f2add209c6f5d449ee2be7af725f1813e8.zip
Adding upstream version 1.33.1.upstream/1.33.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'packaging/installer/dependencies/clearlinux.sh')
-rwxr-xr-xpackaging/installer/dependencies/clearlinux.sh87
1 files changed, 87 insertions, 0 deletions
diff --git a/packaging/installer/dependencies/clearlinux.sh b/packaging/installer/dependencies/clearlinux.sh
index e69de29bb..832dac55a 100755
--- a/packaging/installer/dependencies/clearlinux.sh
+++ b/packaging/installer/dependencies/clearlinux.sh
@@ -0,0 +1,87 @@
+#!/usr/bin/env bash
+# Package tree used for installing netdata on distribution:
+# << ClearLinux: [base] >>
+
+set -e
+
+NON_INTERACTIVE=0
+DONT_WAIT=0
+
+declare -a package_tree=(
+ c-basic
+ make
+ sysadmin-basic
+ devpkg-zlib
+ devpkg-util-linux
+ devpkg-libmnl
+ devpkg-json-c
+ devpkg-libuv
+ devpkg-lz4
+ devpkg-openssl
+ devpkg-elfutils
+ git
+ findutils
+ curl
+ gzip
+ python3-basic
+)
+
+usage() {
+ cat << EOF
+OPTIONS:
+[--dont-wait] [--non-interactive] [ ]
+EOF
+}
+
+check_flags() {
+ while [ -n "${1}" ]; do
+ case "${1}" in
+ dont-wait | --dont-wait | -n)
+ DONT_WAIT=1
+ ;;
+
+ non-interactive | --non-interactive | -y)
+ NON_INTERACTIVE=1
+ ;;
+
+ help | -h | --help)
+ usage
+ exit 1
+ ;;
+ *)
+ echo >&2 "ERROR: Cannot understand option '${1}'"
+ echo >&2
+ usage
+ exit 1
+ ;;
+ esac
+ shift
+ done
+
+ if [ "${DONT_WAIT}" -eq 0 ] && [ "${NON_INTERACTIVE}" -eq 0 ]; then
+ read -r -p "Press ENTER to run it > " || exit 1
+ fi
+}
+
+# shellcheck disable=SC2068
+check_flags ${@}
+
+packages_to_install=
+
+# shellcheck disable=SC2068
+for package in ${package_tree[@]}; do
+ if [[ "$(swupd bundle-info "$package" | grep Status | cut -d':' -f2)" == " Not installed" ]]; then
+ echo "Package '$package' is NOT installed"
+ packages_to_install="$packages_to_install $package"
+ else
+ echo "Package '$package' is installed"
+ fi
+done
+
+if [[ -z $packages_to_install ]]; then
+ echo "All required packages are already installed. Skipping .."
+else
+ echo "packages_to_install: " "${packages_to_install[@]}"
+ # shellcheck disable=SC2068
+ swupd bundle-add ${packages_to_install[@]}
+fi