-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathfunctions.inc.php
38 lines (38 loc) · 1.1 KB
/
functions.inc.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
if (!defined('FREEPBX_IS_AUTH')) { die('No direct script access allowed'); }
// License for all code of this FreePBX module can be found in the license file inside the module directory
// Copyright 2013 Schmooze Com Inc.
//
// Try to determine the distro and kernel of the current machine
function irc_getversioninfo() {
// Various places that may have the Distro Name..
$version = "";
$locations = array(
'Redhat' => '/etc/redhat-release',
'Fedora' => '/etc/fedora-release',
'Debian' => '/etc/debian_version',
'SuSE' => '/etc/SuSE-release',
'Gentoo' => '/etc/gentoo-release'
);
foreach ($locations as $distro => $loc) {
if (is_readable($loc)) {
$fh = fopen($loc, "r");
if ($version != "") {
$version .= " OR ".$distro.' '.fgets($fh, 80);
} else {
$version = $distro.' '.fgets($fh, 80);
}
}
}
if ($version == "") {
return "Unknown Version";
} else {
$lastchar = substr("$version", strlen("$version") - 1, 1);
if ($lastchar == "\n")
{
$version = substr("$version", 0, -1);
}
return $version;
}
}
?>