diff --git a/install/dist/conf/centos72.conf.php b/install/dist/conf/centos72.conf.php index a00b9b53e023de33e1bed3d0bb01027171a3b772..d83ac2300b8f284c565363180e26450f054d8edc 100644 --- a/install/dist/conf/centos72.conf.php +++ b/install/dist/conf/centos72.conf.php @@ -28,7 +28,7 @@ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -//*** Fedora 9 default settings +//*** RHEL 7 derivatives default settings //* Main $conf['language'] = 'en'; diff --git a/install/dist/conf/centos80.conf.php b/install/dist/conf/centos80.conf.php index 9e702b0b7442ad7526a63864a5a75892b410e3c4..dd2abc668a21384b906f987f59da19a9ff24bf06 100644 --- a/install/dist/conf/centos80.conf.php +++ b/install/dist/conf/centos80.conf.php @@ -28,7 +28,7 @@ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -//*** Fedora 9 default settings +//*** RHEL 8 derivatives default settings //* Main $conf['language'] = 'en'; diff --git a/install/dist/conf/centos90.conf.php b/install/dist/conf/centos90.conf.php new file mode 100644 index 0000000000000000000000000000000000000000..909418dc2ef9d2babed8f0f413c3cfa0a1d9e648 --- /dev/null +++ b/install/dist/conf/centos90.conf.php @@ -0,0 +1,232 @@ + diff --git a/install/dist/lib/centos90.lib.php b/install/dist/lib/centos90.lib.php new file mode 100644 index 0000000000000000000000000000000000000000..3dcd7494d3326bd3618d229c950518e8c200f3e4 --- /dev/null +++ b/install/dist/lib/centos90.lib.php @@ -0,0 +1,40 @@ + diff --git a/install/lib/install.lib.php b/install/lib/install.lib.php index d9b482a842f835cd9feed7e52da9894c06d7fae6..7866715b47f63c1023de724ab89e787522539fb9 100644 --- a/install/lib/install.lib.php +++ b/install/lib/install.lib.php @@ -295,88 +295,93 @@ function get_distname() { } //** RHEL (including compatible clones) & Fedora - elseif(file_exists('/etc/redhat-release') && file_exists('/etc/os-release')) { - - $content = file_get_contents('/etc/os-release'); - - preg_match('/(?<=PRETTY_NAME=\").+?(?=\")/', $content, $prettyname); - preg_match('/(?<=NAME=\").+?(?=\")/', $content, $name); - preg_match('/(?<=VERSION=\").+?(?=\")/', $content, $version); - preg_match('/(?<=VERSION_ID=\").+?(?=\")/', $content, $versionid); - - if(stristr($prettyname[0], 'Fedora 32 (Thirty Two)')) { - $distname = 'Fedora'; - $distver = '32'; - $distid = 'fedora32'; - $distbaseid = 'fedora'; - swriteln("Operating System: Fedora 32 or compatible\n"); - } elseif(stristr($prettyname[0], 'Fedora 33 (Thirty Three)')) { - $distname = 'Fedora'; - $distver = '33'; - $distid = 'fedora33'; - $distbaseid = 'fedora'; - swriteln("Operating System: Fedora 33 or compatible\n"); - //** RHEL 7 and compatible clones - } elseif(preg_match('/^(?:7|7\.[0-9]{1,2})$/', $versionid[0])) { - preg_match_all('/([0-9]{1,2})\.?([0-9]{0,2})\.?([0-9]*)/', file_get_contents('/etc/redhat-release'), $centos7_version); - $distname = $name[0]; - $distver = is_array($centos7_version)? implode('.', array_filter(array($centos7_version[1][0],$centos7_version[2][0],$centos7_version[3][0]),'strlen')) : $version[0]; - $distid = 'centos72'; - $distbaseid = 'fedora'; - swriteln("Operating System: " . $distname . " " . $distver . "\n"); - //** RHEL 8 and compatible clones - } elseif(preg_match('/^(?:8|8\.[0-9]{1,2})$/', $versionid[0])) { - $distname = $name[0]; - $distver = $version[0]; - $distid = 'centos80'; - $distbaseid = 'fedora'; - swriteln("Operating System: " . $prettyname[0] . "\n"); - } else { - $distname = 'Redhat'; - $distver = 'Unknown'; - $distid = 'fedora9'; - $distbaseid = 'fedora'; - swriteln("Operating System: Redhat or compatible\n"); - } + elseif(file_exists('/etc/redhat-release') && file_exists('/etc/os-release')) { + + $content = file_get_contents('/etc/os-release'); + + preg_match('/(?<=PRETTY_NAME=\").+?(?=\")/', $content, $prettyname); + preg_match('/(?<=NAME=\").+?(?=\")/', $content, $name); + preg_match('/(?<=VERSION=\").+?(?=\")/', $content, $version); + preg_match('/(?<=VERSION_ID=\").+?(?=\")/', $content, $versionid); + + if(stristr($prettyname[0], 'Fedora 32 (Thirty Two)')) { + $distname = 'Fedora'; + $distver = '32'; + $distid = 'fedora32'; + $distbaseid = 'fedora'; + swriteln("Operating System: Fedora 32 or compatible\n"); + } elseif(stristr($prettyname[0], 'Fedora 33 (Thirty Three)')) { + $distname = 'Fedora'; + $distver = '33'; + $distid = 'fedora33'; + $distbaseid = 'fedora'; + swriteln("Operating System: Fedora 33 or compatible\n"); + //** RHEL 7 and compatible clones + } elseif(preg_match('/^(?:7|7\.[0-9]{1,2})$/', $versionid[0])) { + preg_match_all('/([0-9]{1,2})\.?([0-9]{0,2})\.?([0-9]*)/', file_get_contents('/etc/redhat-release'), $centos7_version); + $distname = $name[0]; + $distver = is_array($centos7_version)? implode('.', array_filter(array($centos7_version[1][0],$centos7_version[2][0],$centos7_version[3][0]),'strlen')) : $version[0]; + $distid = 'centos72'; + $distbaseid = 'fedora'; + swriteln("Operating System: " . $distname . " " . $distver . "\n"); + //** RHEL 8 and compatible clones + } elseif(preg_match('/^(?:8|8\.[0-9]{1,2})$/', $versionid[0])) { + $distname = $name[0]; + $distver = $version[0]; + $distid = 'centos80'; + $distbaseid = 'fedora'; + swriteln("Operating System: " . $prettyname[0] . "\n"); + //** RHEL 9 and compatible clones + } elseif(preg_match('/^(?:9|9\.[0-9]{1,2})$/', $versionid[0])) { + $distname = $name[0]; + $distver = $version[0]; + $distid = 'centos90'; + $distbaseid = 'fedora'; + swriteln("Operating System: " . $prettyname[0] . "\n"); + } else { + $distname = 'Redhat'; + $distver = 'Unknown'; + $distid = 'fedora9'; + $distbaseid = 'fedora'; + swriteln("Operating System: Redhat or compatible\n"); + } //** CentOS 6 - } elseif(file_exists('/etc/redhat-release') && !file_exists('/etc/os-release') && !file_exists('/etc/els-release')) { + } elseif(file_exists('/etc/redhat-release') && !file_exists('/etc/os-release') && !file_exists('/etc/els-release')) { - $content = file_get_contents('/etc/redhat-release'); + $content = file_get_contents('/etc/redhat-release'); - if(stristr($content, 'CentOS Linux release 6') || stristr($content, 'CentOS release 6')) { - preg_match_all('/(6\.?([0-9]{0,2})\.?(\s)?([a-zA-Z()]+))$/', $content, $centos6_version); - $distname = 'CentOS Linux'; + if(stristr($content, 'CentOS Linux release 6') || stristr($content, 'CentOS release 6')) { + preg_match_all('/(6\.?([0-9]{0,2})\.?(\s)?([a-zA-Z()]+))$/', $content, $centos6_version); + $distname = 'CentOS Linux'; $distver = $centos6_version[0][0] ? $centos6_version[0][0] : '6'; $distid = 'centos53'; $distbaseid = 'fedora'; - swriteln("Operating System: " . $distname . " " . $distver . "\n"); - - } else { - $distname = 'Redhat'; - $distver = 'Unknown'; - $distid = 'fedora9'; - $distbaseid = 'fedora'; - } + swriteln("Operating System: " . $distname . " " . $distver . "\n"); + } else { + $distname = 'Redhat'; + $distver = 'Unknown'; + $distid = 'fedora9'; + $distbaseid = 'fedora'; + } //** CentOS 6 Extended Lifecycle Support by CloudLinux - } elseif(file_exists('/etc/redhat-release') && file_exists('/etc/els-release') && !file_exists('/etc/os-release')) { + } elseif(file_exists('/etc/redhat-release') && file_exists('/etc/els-release') && !file_exists('/etc/os-release')) { - $content = file_get_contents('/etc/els-release'); + $content = file_get_contents('/etc/els-release'); - if(stristr($content, 'CentOS Linux release 6') || stristr($content, 'CentOS release 6')) { - preg_match_all('/(6)\.?([0-9]{0,2})?\.?\s([a-zA-Z(), ]+)?$/', $content, $centos6_version); - $distname = 'CentOS Linux'; - $distver = $centos6_version[0][0] ? $centos6_version[0][0] : '6'; - $distid = 'centos53'; + if(stristr($content, 'CentOS Linux release 6') || stristr($content, 'CentOS release 6')) { + preg_match_all('/(6)\.?([0-9]{0,2})?\.?\s([a-zA-Z(), ]+)?$/', $content, $centos6_version); + $distname = 'CentOS Linux'; + $distver = $centos6_version[0][0] ? $centos6_version[0][0] : '6'; + $distid = 'centos53'; $distbaseid = 'fedora'; - swriteln("Operating System: " . $distname . " " . $distver . "\n"); - } else { - $distname = 'Redhat'; - $distver = 'Unknown'; - $distid = 'fedora9'; - $distbaseid = 'fedora'; - } - } - + swriteln("Operating System: " . $distname . " " . $distver . "\n"); + } else { + $distname = 'Redhat'; + $distver = 'Unknown'; + $distid = 'fedora9'; + $distbaseid = 'fedora'; + } + } //** Gentoo elseif(file_exists('/etc/gentoo-release')) { diff --git a/server/lib/classes/monitor_tools.inc.php b/server/lib/classes/monitor_tools.inc.php index bb0124a26c20a0bfe5f58c4d6a828c643f79fc63..3d540ac8c863097148121db6791463b910b9fdbd 100644 --- a/server/lib/classes/monitor_tools.inc.php +++ b/server/lib/classes/monitor_tools.inc.php @@ -275,7 +275,6 @@ class monitor_tools { } } - //** RHEL (including compatible clones) & Fedora elseif(file_exists('/etc/redhat-release') && file_exists('/etc/os-release')) { @@ -296,7 +295,7 @@ class monitor_tools { $distver = '33'; $distid = 'fedora33'; $distbaseid = 'fedora'; - //** RHEL 7 and compatible clones + //** RHEL 7 and compatible clones } elseif(preg_match('/^(?:7|7\.[0-9]{1,2})$/', $versionid[0])) { preg_match_all('/([0-9]{1,2})\.?([0-9]{0,2})\.?([0-9]*)/', file_get_contents('/etc/redhat-release'), $centos7_version); $distname = $name[0]; @@ -309,6 +308,12 @@ class monitor_tools { $distver = $version[0]; $distid = 'centos80'; $distbaseid = 'fedora'; + //** RHEL 9 and compatible clones + } elseif(preg_match('/^(?:9|9\.[0-9]{1,2})$/', $versionid[0])) { + $distname = $name[0]; + $distver = $version[0]; + $distid = 'centos90'; + $distbaseid = 'fedora'; } else { $distname = 'Redhat'; $distver = 'Unknown'; @@ -316,41 +321,40 @@ class monitor_tools { $distbaseid = 'fedora'; } //** CentOS 6 - } elseif(file_exists('/etc/redhat-release') && !file_exists('/etc/os-release') && !file_exists('/etc/els-release')) { - - $content = file_get_contents('/etc/redhat-release'); - - if(stristr($content, 'CentOS Linux release 6') || stristr($content, 'CentOS release 6')) { - preg_match_all('/(6\.?([0-9]{0,2})\.?(\s)?([a-zA-Z()]+))$/', $content, $centos6_version); - $distname = 'CentOS Linux'; - $distver = $centos6_version[0][0] ? $centos6_version[0][0] : '6'; - $distid = 'centos53'; - $distbaseid = 'fedora'; - } else { - $distname = 'Redhat'; - $distver = 'Unknown'; - $distid = 'fedora9'; - $distbaseid = 'fedora'; - } + } elseif(file_exists('/etc/redhat-release') && !file_exists('/etc/os-release') && !file_exists('/etc/els-release')) { + + $content = file_get_contents('/etc/redhat-release'); + + if(stristr($content, 'CentOS Linux release 6') || stristr($content, 'CentOS release 6')) { + preg_match_all('/(6\.?([0-9]{0,2})\.?(\s)?([a-zA-Z()]+))$/', $content, $centos6_version); + $distname = 'CentOS Linux'; + $distver = $centos6_version[0][0] ? $centos6_version[0][0] : '6'; + $distid = 'centos53'; + $distbaseid = 'fedora'; + } else { + $distname = 'Redhat'; + $distver = 'Unknown'; + $distid = 'fedora9'; + $distbaseid = 'fedora'; + } //** CentOS 6 Extended Lifecycle Support by CloudLinux } elseif(file_exists('/etc/redhat-release') && file_exists('/etc/els-release') && !file_exists('/etc/os-release')) { - $content = file_get_contents('/etc/els-release'); - - if(stristr($content, 'CentOS Linux release 6') || stristr($content, 'CentOS release 6')) { - preg_match_all('/(6)\.?([0-9]{0,2})?\.?\s([a-zA-Z(), ]+)?$/', $content, $centos6_version); - $distname = 'CentOS Linux'; - $distver = $centos6_version[0][0] ? $centos6_version[0][0] : '6'; - $distid = 'centos53'; - $distbaseid = 'fedora'; - } else { - $distname = 'Redhat'; - $distver = 'Unknown'; - $distid = 'fedora9'; - $distbaseid = 'fedora'; - } - } + $content = file_get_contents('/etc/els-release'); + if(stristr($content, 'CentOS Linux release 6') || stristr($content, 'CentOS release 6')) { + preg_match_all('/(6)\.?([0-9]{0,2})?\.?\s([a-zA-Z(), ]+)?$/', $content, $centos6_version); + $distname = 'CentOS Linux'; + $distver = $centos6_version[0][0] ? $centos6_version[0][0] : '6'; + $distid = 'centos53'; + $distbaseid = 'fedora'; + } else { + $distname = 'Redhat'; + $distver = 'Unknown'; + $distid = 'fedora9'; + $distbaseid = 'fedora'; + } + } //** Gentoo elseif(file_exists('/etc/gentoo-release')) {