| | |
| | | $distid = ''; |
| | | $distbaseid = ''; |
| | | |
| | | //** Debian or Ubuntu |
| | | if(file_exists('/etc/debian_version')) { |
| | | //** Debian or Ubuntu |
| | | if (is_file('/etc/os-release') && stristr(file_get_contents('/etc/os-release'), 'Ubuntu')) { |
| | | $os_release = file_get_contents('/etc/os-release'); |
| | | if (strstr(trim($os_release), 'LTS')) { |
| | | $lts = " LTS"; |
| | | } else { |
| | | $lts = ""; |
| | | } |
| | | |
| | | preg_match("/.*VERSION=\"(.*)\".*/ui", $os_release, $ver); |
| | | $ver = str_replace("LTS", "", $ver[1]); |
| | | $ver = explode(" ", $ver, 2); |
| | | $relname = end($ver); |
| | | $relname = "(" . trim(trim($relname), "()") . ")"; |
| | | $distname = 'Ubuntu'; |
| | | $ver = reset($ver); |
| | | $distid = 'debian40'; |
| | | $distbaseid = 'debian'; |
| | | $distver = $ver . $lts . " " . $relname; |
| | | swriteln("Operating System: " . $distver . "\n"); |
| | | } //** Debian / Ubuntu |
| | | elseif(file_exists('/etc/debian_version')) { |
| | | if (strstr(trim(file_get_contents('/etc/issue')), 'Ubuntu')) { |
| | | if (strstr(trim(file_get_contents('/etc/issue')), 'LTS')) { |
| | | $lts=" LTS"; |
| | |
| | | $mainver = array_filter($mainver); |
| | | $mainver = current($mainver).'.'.next($mainver); |
| | | switch ($mainver){ |
| | | case "16.04": |
| | | $relname = "(Xenial Xerus)"; |
| | | $distid = 'ubuntu1604'; |
| | | break; |
| | | case "15.10": |
| | | $relname = "(Wily Werewolf)"; |
| | | break; |
| | | case "15.04": |
| | | $relname = "(Vivid Vervet)"; |
| | | break; |
| | | case "14.10": |
| | | $relname = "(Utopic Unicorn)"; |
| | | break; |
| | |
| | | $distid = 'centos53'; |
| | | $distbaseid = 'fedora'; |
| | | swriteln("Operating System: CentOS 6 or compatible\n"); |
| | | } elseif(stristr($content, 'CentOS Linux release 7.2')) { |
| | | $distname = 'CentOS'; |
| | | $distver = 'Unknown'; |
| | | $distid = 'centos72'; |
| | | $distbaseid = 'fedora'; |
| | | swriteln("Operating System: CentOS 7.2\n"); |
| | | } elseif(stristr($content, 'CentOS Linux release 7')) { |
| | | $distname = 'CentOS'; |
| | | $distver = 'Unknown'; |