Skip to content

Commit

Permalink
Add support for Sangoma Linux (FreePBX), CentOS-based
Browse files Browse the repository at this point in the history
  • Loading branch information
stormi committed Oct 16, 2019
1 parent 7e4c5c9 commit 87028b0
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mk/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ select_pkgs_rhel()
rhel8|centos8|oracle8|scientific8|neokylin8|cloudlinux8)
# No additional kernel package
;;
alpine3*)
alpine3*|sangoma*)
# No additional kernel package
;;
rhel3|fedora*)
Expand Down Expand Up @@ -513,7 +513,7 @@ install_coreos()
case "${os_distro}" in
rhel|centos|oracle|fedora) select_pkgs_rhel ;;
scientific|neokylin|asianux|turbo) select_pkgs_rhel ;;
alpine|cloudlinux) select_pkgs_rhel ;;
alpine|cloudlinux|sangoma) select_pkgs_rhel ;;
sles|"suse linux") select_pkgs_sles ;;
debian|ubuntu|linx|yinhe) select_pkgs_debian ;;
xe-ddk|xe-sdk) select_pkgs_xe ;;
Expand Down
30 changes: 30 additions & 0 deletions mk/xe-linux-distribution
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,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]*\)\(\.[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 @@ -509,6 +538,7 @@ if [ -z "${TEST}" ] ; then
identify_debian /etc/debian_version && exit 0
identify_boot2docker /etc/boot2docker && exit 0
identify_alpine /etc/alpine-release && exit 0
identify_sangoma /etc/centos-release && exit 0


if [ $# -eq 1 ] ; then
Expand Down

0 comments on commit 87028b0

Please sign in to comment.