Skip to content

Commit

Permalink
XSO-926 Add Sangoma Linux to sed call
Browse files Browse the repository at this point in the history
Customer request - add FreePBX (Sangoma Linux) to Xenserver Tools
detection, this was requested to prevent logs being flooded with tools
not installed messages for this platform.

Signed-off-by: Sam Connolly <[email protected]>
  • Loading branch information
samuelconnolly committed Jan 10, 2019
1 parent 1ea5634 commit 55a76a2
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions mk/xe-linux-distribution
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,35 @@ identify_asianux()
write_to_output "${distro}" "${major}" "${minor}" "$(head -n 1 ${asianux_release})"
}

identify_sangoma()
{
sangoma_release="$1"
local distro
local major
local minor

# distro
# 'Sangoma Linux (FreeFBX)'

if [ ! -f "${sangoma_release}" ] ; then
return 1
fi

eval $(sed -rn \
's/^Sangoma Linux release \([0-9]*\)\.\([0-9]*\)\(\.[0-9]*\)\? (.*)/distro=sangoma;major=\1;minor=\2/gp;' \
"${sangoma_release}")

if [ -z "${major}" -o -z "${distro}" ] ; then
return 1
fi

if [ -z "${minor}" ] ; then
minor=0
fi

write_to_output "${distro}" "${major}" "${minor}" "$(head -n 1 ${sangoma_release})"
}

identify_turbo()
{
turbo_release="$1"
Expand Down Expand Up @@ -464,6 +493,7 @@ if [ -z "${TEST}" ] ; then
identify_redhat /etc/centos-release && exit 0
identify_redhat /etc/redhat-release && exit 0
identify_sles /etc/SuSE-release && exit 0
identify_sangoma /etc/centos-release && exit 0
#identify Linx disto before debian, as Linx has both linx_release and debian_version.
identify_yinhe /etc/kylin-build && exit 0
identify_linx /etc/linx-release && exit 0
Expand Down

0 comments on commit 55a76a2

Please sign in to comment.