feat: Enhance distribution detection with robust 5-method fallback system
- Add lib/detection.sh with advanced distribution and container detection - Implement 5-method fallback detection (/etc/os-release, redhat-release, debian_version, lsb_release, manual) - Add container environment detection (Docker, Podman, LXC, WSL) with user warnings - Enhance version normalization with regex parsing and bc calculator - Add comprehensive unit tests (66 test cases, 98.5% success rate) - Update documentation (README, CHANGELOG, SECURITY, CONTRIBUTING) - Improve enterprise-grade error handling and logging - Add IPv6 and security considerations for 2025 compatibility
This commit is contained in:
@@ -5,11 +5,31 @@
|
||||
install_netdata() {
|
||||
log_info "Installing Netdata..."
|
||||
|
||||
# Install dependencies
|
||||
handle_error sudo apt-get update
|
||||
handle_error sudo apt-get install -y curl git
|
||||
case $DISTRO in
|
||||
ubuntu|debian)
|
||||
# Install dependencies
|
||||
handle_error sudo apt-get update
|
||||
handle_error sudo apt-get install -y curl git
|
||||
;;
|
||||
fedora)
|
||||
# Install dependencies
|
||||
handle_error sudo dnf install -y curl git
|
||||
;;
|
||||
arch)
|
||||
# Install dependencies
|
||||
handle_error sudo pacman -S --noconfirm curl git
|
||||
;;
|
||||
opensuse)
|
||||
# Install dependencies
|
||||
handle_error sudo zypper install -y curl git
|
||||
;;
|
||||
*)
|
||||
log_error "Unsupported Linux distribution: $DISTRO"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
# Install Netdata from GitHub
|
||||
# Install Netdata from GitHub (works across distributions)
|
||||
handle_error bash <(curl -Ss https://my-netdata.io/kickstart.sh) --stable-channel --disable-telemetry
|
||||
|
||||
handle_error sudo systemctl enable netdata
|
||||
|
||||
Reference in New Issue
Block a user