Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for FreePBX (sangoma) in xe-linux-distribution #101

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions mk/xe-linux-distribution
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,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 (FreePBX)'

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

eval $(sed -rn \
's/^Sangoma Linux release ([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 @@ -520,6 +549,7 @@ if [ -z "${TEST}" ] ; then
identify_redhat /etc/almalinux-release && exit 0
identify_redhat /etc/centos-release && exit 0
identify_redhat /etc/redhat-release && exit 0
identify_sangoma /etc/centos-release && exit 0
#identify SuSE-release before, as previous version of SUSE or other distros also have os-release
identify_sles /etc/SuSE-release && exit 0
identify_sles /etc/os-release && exit 0
Expand Down