mirror of
https://github.com/snipe/snipe-it.git
synced 2026-08-18 03:06:23 +00:00
Merge remote-tracking branch 'origin/develop'
This commit is contained in:
30
snipeit.sh
30
snipeit.sh
@ -321,19 +321,31 @@ rename_default_vhost () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if [[ -f /etc/debian_version || -f /etc/lsb-release ]]; then
|
# Prefer /etc/os-release because it is the modern cross-distro standard and
|
||||||
distro="$(lsb_release -is)"
|
# is always present on every distro this installer supports. Debian 13
|
||||||
version="$(lsb_release -rs)"
|
# stopped shipping lsb_release by default (issue #19469), so the old path
|
||||||
codename="$(lsb_release -cs)"
|
# that shelled out to `lsb_release` produced empty distro/version/codename
|
||||||
elif [ -f /etc/os-release ]; then
|
# on a fresh Debian 13 install and broke everything downstream.
|
||||||
|
#
|
||||||
|
# lsb_release stays as a fallback for very old systems that predate the
|
||||||
|
# os-release standard.
|
||||||
|
#
|
||||||
|
# Order is important below. If /etc/os-release and /etc/centos-release both
|
||||||
|
# exist, we are on CentOS 7 and os-release handles it. If only
|
||||||
|
# /etc/centos-release exists, we are on CentOS 6 or earlier, which is not
|
||||||
|
# parsable, so we assume version 6. /etc/os-release also properly detects
|
||||||
|
# Fedora.
|
||||||
|
if [ -f /etc/os-release ]; then
|
||||||
# shellcheck disable=SC1091
|
# shellcheck disable=SC1091
|
||||||
distro="$(source /etc/os-release && echo "$ID")"
|
distro="$(source /etc/os-release && echo "$ID")"
|
||||||
# shellcheck disable=SC1091
|
# shellcheck disable=SC1091
|
||||||
version="$(source /etc/os-release && echo "$VERSION_ID")"
|
version="$(source /etc/os-release && echo "$VERSION_ID")"
|
||||||
#Order is important here. If /etc/os-release and /etc/centos-release exist, we're on centos 7.
|
# shellcheck disable=SC1091
|
||||||
#If only /etc/centos-release exist, we're on centos6(or earlier). Centos-release is less parsable,
|
codename="$(source /etc/os-release && echo "$VERSION_CODENAME")"
|
||||||
#so lets assume that it's version 6 (Plus, who would be doing a new install of anything on centos5 at this point..)
|
elif [[ -f /etc/debian_version || -f /etc/lsb-release ]]; then
|
||||||
#/etc/os-release properly detects fedora
|
distro="$(lsb_release -is)"
|
||||||
|
version="$(lsb_release -rs)"
|
||||||
|
codename="$(lsb_release -cs)"
|
||||||
elif [ -f /etc/centos-release ]; then
|
elif [ -f /etc/centos-release ]; then
|
||||||
distro="centos"
|
distro="centos"
|
||||||
version="6"
|
version="6"
|
||||||
|
|||||||
Reference in New Issue
Block a user