feat: add bds core, locale updates and safety fixes
This commit is contained in:
33
lib/detect.sh
Normal file
33
lib/detect.sh
Normal file
@@ -0,0 +1,33 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
detect_system() {
|
||||
if [[ -f /etc/os-release ]]; then
|
||||
# shellcheck disable=SC1091
|
||||
. /etc/os-release
|
||||
OS_ID="${ID:-unknown}"
|
||||
OS_VERSION="${VERSION_ID:-unknown}"
|
||||
OS_NAME="${PRETTY_NAME:-unknown}"
|
||||
else
|
||||
fail "$(t detect_os_failed)"
|
||||
fi
|
||||
|
||||
ARCHITECTURE="$(uname -m)"
|
||||
|
||||
if command -v apt-get >/dev/null 2>&1; then
|
||||
PKG_MANAGER="apt"
|
||||
elif command -v dnf >/dev/null 2>&1; then
|
||||
PKG_MANAGER="dnf"
|
||||
elif command -v yum >/dev/null 2>&1; then
|
||||
PKG_MANAGER="yum"
|
||||
elif command -v pacman >/dev/null 2>&1; then
|
||||
PKG_MANAGER="pacman"
|
||||
else
|
||||
fail "$(t no_package_manager)"
|
||||
fi
|
||||
|
||||
if command -v systemctl >/dev/null 2>&1; then
|
||||
INIT_SYSTEM="systemd"
|
||||
else
|
||||
INIT_SYSTEM="none"
|
||||
fi
|
||||
}
|
||||
Reference in New Issue
Block a user