Skip to content

Commit 90511b7

Browse files
committed
- reorganized the installer - part 3
1 parent 5447d9c commit 90511b7

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

install/install.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
if($dist['id'] == '') die('Linux Dustribution or Version not recognized.');
6363

6464
//** Include the distribution specific installer class library and configuration
65-
if(is_file('dist/lib/'.strtolower($dist['name']).'.lib.php')) include_once('dist/lib/'.strtolower($dist['name']).'.lib.php');
65+
if(is_file('dist/lib/'.$dist['baseid'].'.lib.php')) include_once('dist/lib/'.$dist['baseid'].'.lib.php');
6666
include_once('dist/lib/'.$dist['id'].'.lib.php');
6767
include_once('dist/conf/'.$dist['id'].'.conf.php');
6868

install/lib/install.lib.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,14 @@ function get_distname() {
6868
$distname = 'Debian';
6969
$distver = '4.0';
7070
$distid = 'debian40';
71+
$distbaseid = 'debian';
7172
swriteln("Operating System: Debian 4.0 or compatible\n");
7273
}
7374
if(trim(file_get_contents('/etc/debian_version')) == 'lenny/sid') {
7475
$distname = 'Debian';
7576
$distver = 'Lenny/Sid';
7677
$distid = 'debian40';
78+
$distbaseid = 'debian';
7779
swriteln("Operating System: Debian Lenny/Sid or compatible\n");
7880
}
7981
}
@@ -84,6 +86,7 @@ function get_distname() {
8486
$distname = 'openSUSE';
8587
$distver = '11.0';
8688
$distid = 'opensuse110';
89+
$distbaseid = 'opensuse';
8790
swriteln("Operating System: openSUSE 11.0 or compatible\n");
8891
}
8992
}
@@ -98,6 +101,7 @@ function get_distname() {
98101
$distname = 'Fedora';
99102
$distver = '9';
100103
$distid = 'fedora9';
104+
$distbaseid = 'fedora';
101105
swriteln("Operating System: Fedora 9 or compatible\n");
102106
}
103107

@@ -106,7 +110,7 @@ function get_distname() {
106110
die('unrecognized linux distribution');
107111
}
108112

109-
return array('name' => $distname, 'version' => $distver, 'id' => $distid);
113+
return array('name' => $distname, 'version' => $distver, 'id' => $distid, 'baseid' => $distbaseid);
110114
}
111115

112116
function sread() {

install/update.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,18 @@
5959
}
6060

6161
//** Get distribution identifier
62-
$distname = get_distname();
62+
$dist = get_distname();
6363

6464
include_once("/usr/local/ispconfig/server/lib/config.inc.php");
6565
$conf_old = $conf;
6666
unset($conf);
6767

68+
if($dist['id'] == '') die('Linux Dustribution or Version not recognized.');
69+
6870
//** Include the distribution specific installer class library and configuration
69-
include_once('dist/lib/'.$distname.'.lib.php');
70-
include_once('dist/conf/'.$distname.'.conf.php');
71+
if(is_file('dist/lib/'.$dist['baseid'].'.lib.php')) include_once('dist/lib/'.$dist['baseid'].'.lib.php');
72+
include_once('dist/lib/'.$dist['id'].'.lib.php');
73+
include_once('dist/conf/'.$dist['id'].'.conf.php');
7174

7275
//** Get hostname
7376
exec('hostname -f', $tmp_out);

0 commit comments

Comments
 (0)