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 Aug 2, 2022
1 parent 2961851 commit ef07605
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mk/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ select_pkgs_rhel()
rhel8|oracle8|centos8|rocky8|cloudlinux8)
# No additional kernel package
;;
sangoma*)
# No additional kernel package
;;
rhel3|fedora*)
# Not officially supported therefore no additional packages required.
;;
Expand Down Expand Up @@ -517,7 +520,7 @@ install_coreos()
case "${os_distro}" in
rhel|centos|oracle|fedora|rocky) select_pkgs_rhel ;;
scientific|neokylin|asianux|turbo) select_pkgs_rhel ;;
cloudlinux) select_pkgs_rhel ;;
cloudlinux|sangoma) select_pkgs_rhel ;;
sles|"suse linux") select_pkgs_sles ;;
debian|ubuntu|linx|yinhe|Gooroom) 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 @@ -402,6 +402,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 @@ -568,6 +597,7 @@ if [ -z "${TEST}" ] ; then
identify_lsb lsb_release && exit 0
identify_debian /etc/debian_version && exit 0
identify_boot2docker /etc/boot2docker && exit 0
identify_sangoma /etc/centos-release && exit 0
identify_os_release /etc/os-release && exit 0


Expand Down

0 comments on commit ef07605

Please sign in to comment.