From dc7aa0813f52eed4eb039a21ee13d6a5cb7f104c Mon Sep 17 00:00:00 2001
From: Till Brehm <tbrehm@ispconfig.org>
Date: Thu, 19 May 2016 05:01:32 -0400
Subject: [PATCH] Merge branch 'master' into 'stable-3.1'

---
 install/lib/install.lib.php |   34 ++++++++++++++++++++++++++++++++--
 1 files changed, 32 insertions(+), 2 deletions(-)

diff --git a/install/lib/install.lib.php b/install/lib/install.lib.php
index 08b0f84..3afc988 100644
--- a/install/lib/install.lib.php
+++ b/install/lib/install.lib.php
@@ -66,8 +66,28 @@
 	$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";
@@ -86,6 +106,10 @@
 			$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;
@@ -276,6 +300,12 @@
 			$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';

--
Gitblit v1.9.1