Commit 90511b77 authored by tbrehm's avatar tbrehm
Browse files

- reorganized the installer - part 3

parent 5447d9c2
...@@ -62,7 +62,7 @@ $dist = get_distname(); ...@@ -62,7 +62,7 @@ $dist = get_distname();
if($dist['id'] == '') die('Linux Dustribution or Version not recognized.'); if($dist['id'] == '') die('Linux Dustribution or Version not recognized.');
//** Include the distribution specific installer class library and configuration //** Include the distribution specific installer class library and configuration
if(is_file('dist/lib/'.strtolower($dist['name']).'.lib.php')) include_once('dist/lib/'.strtolower($dist['name']).'.lib.php'); if(is_file('dist/lib/'.$dist['baseid'].'.lib.php')) include_once('dist/lib/'.$dist['baseid'].'.lib.php');
include_once('dist/lib/'.$dist['id'].'.lib.php'); include_once('dist/lib/'.$dist['id'].'.lib.php');
include_once('dist/conf/'.$dist['id'].'.conf.php'); include_once('dist/conf/'.$dist['id'].'.conf.php');
......
...@@ -68,12 +68,14 @@ function get_distname() { ...@@ -68,12 +68,14 @@ function get_distname() {
$distname = 'Debian'; $distname = 'Debian';
$distver = '4.0'; $distver = '4.0';
$distid = 'debian40'; $distid = 'debian40';
$distbaseid = 'debian';
swriteln("Operating System: Debian 4.0 or compatible\n"); swriteln("Operating System: Debian 4.0 or compatible\n");
} }
if(trim(file_get_contents('/etc/debian_version')) == 'lenny/sid') { if(trim(file_get_contents('/etc/debian_version')) == 'lenny/sid') {
$distname = 'Debian'; $distname = 'Debian';
$distver = 'Lenny/Sid'; $distver = 'Lenny/Sid';
$distid = 'debian40'; $distid = 'debian40';
$distbaseid = 'debian';
swriteln("Operating System: Debian Lenny/Sid or compatible\n"); swriteln("Operating System: Debian Lenny/Sid or compatible\n");
} }
} }
...@@ -84,6 +86,7 @@ function get_distname() { ...@@ -84,6 +86,7 @@ function get_distname() {
$distname = 'openSUSE'; $distname = 'openSUSE';
$distver = '11.0'; $distver = '11.0';
$distid = 'opensuse110'; $distid = 'opensuse110';
$distbaseid = 'opensuse';
swriteln("Operating System: openSUSE 11.0 or compatible\n"); swriteln("Operating System: openSUSE 11.0 or compatible\n");
} }
} }
...@@ -98,6 +101,7 @@ function get_distname() { ...@@ -98,6 +101,7 @@ function get_distname() {
$distname = 'Fedora'; $distname = 'Fedora';
$distver = '9'; $distver = '9';
$distid = 'fedora9'; $distid = 'fedora9';
$distbaseid = 'fedora';
swriteln("Operating System: Fedora 9 or compatible\n"); swriteln("Operating System: Fedora 9 or compatible\n");
} }
...@@ -106,7 +110,7 @@ function get_distname() { ...@@ -106,7 +110,7 @@ function get_distname() {
die('unrecognized linux distribution'); die('unrecognized linux distribution');
} }
return array('name' => $distname, 'version' => $distver, 'id' => $distid); return array('name' => $distname, 'version' => $distver, 'id' => $distid, 'baseid' => $distbaseid);
} }
function sread() { function sread() {
......
...@@ -59,15 +59,18 @@ if(is_dir('/root/ispconfig') || is_dir('/home/admispconfig')) { ...@@ -59,15 +59,18 @@ if(is_dir('/root/ispconfig') || is_dir('/home/admispconfig')) {
} }
//** Get distribution identifier //** Get distribution identifier
$distname = get_distname(); $dist = get_distname();
include_once("/usr/local/ispconfig/server/lib/config.inc.php"); include_once("/usr/local/ispconfig/server/lib/config.inc.php");
$conf_old = $conf; $conf_old = $conf;
unset($conf); unset($conf);
if($dist['id'] == '') die('Linux Dustribution or Version not recognized.');
//** Include the distribution specific installer class library and configuration //** Include the distribution specific installer class library and configuration
include_once('dist/lib/'.$distname.'.lib.php'); if(is_file('dist/lib/'.$dist['baseid'].'.lib.php')) include_once('dist/lib/'.$dist['baseid'].'.lib.php');
include_once('dist/conf/'.$distname.'.conf.php'); include_once('dist/lib/'.$dist['id'].'.lib.php');
include_once('dist/conf/'.$dist['id'].'.conf.php');
//** Get hostname //** Get hostname
exec('hostname -f', $tmp_out); exec('hostname -f', $tmp_out);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment