Commit 34439310 authored by tbrehm's avatar tbrehm
Browse files

- reorganized the installer - part 1

parent 6444a957
...@@ -28,7 +28,7 @@ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, ...@@ -28,7 +28,7 @@ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
class installer extends installer_base { class installer_dist extends installer_base {
function configure_postfix($options = '') function configure_postfix($options = '')
{ {
......
...@@ -57,13 +57,14 @@ require_once('lib/install.lib.php'); ...@@ -57,13 +57,14 @@ require_once('lib/install.lib.php');
require_once('lib/installer_base.lib.php'); require_once('lib/installer_base.lib.php');
//** Get distribution identifier //** Get distribution identifier
$distname = get_distname(); $dist = get_distname();
if($distname == '') 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
include_once('dist/lib/'.$distname.'.lib.php'); if(is_file('dist/lib/'.strtolower($dist['name']).'.lib.php')) include_once('dist/lib/'.strtolower($dist['name']).'.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');
//** Install logfile //** Install logfile
define('ISPC_LOG_FILE', '/var/log/ispconfig_install.log'); define('ISPC_LOG_FILE', '/var/log/ispconfig_install.log');
......
...@@ -65,11 +65,15 @@ function get_distname() { ...@@ -65,11 +65,15 @@ function get_distname() {
if(file_exists('/etc/debian_version')) { if(file_exists('/etc/debian_version')) {
if(trim(file_get_contents('/etc/debian_version')) == '4.0') { if(trim(file_get_contents('/etc/debian_version')) == '4.0') {
$distname = 'debian40'; $distname = 'Debian';
$distver = '4.0';
$distid = 'debian40';
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 = 'debian40'; $distname = 'Debian';
$distver = 'Lenny/Sid';
$distid = 'debian40';
swriteln("Operating System: Debian Lenny/Sid or compatible\n"); swriteln("Operating System: Debian Lenny/Sid or compatible\n");
} }
} }
...@@ -77,7 +81,9 @@ function get_distname() { ...@@ -77,7 +81,9 @@ function get_distname() {
//** OpenSuSE //** OpenSuSE
elseif(file_exists("/etc/SuSE-release")) { elseif(file_exists("/etc/SuSE-release")) {
if(stristr(file_get_contents('/etc/SuSE-release'),'11.0')) { if(stristr(file_get_contents('/etc/SuSE-release'),'11.0')) {
$distname = 'opensuse110'; $distname = 'openSUSE';
$distver = '11.0';
$distid = 'opensuse110';
swriteln("Operating System: openSUSE 11.0 or compatible\n"); swriteln("Operating System: openSUSE 11.0 or compatible\n");
} }
} }
...@@ -89,7 +95,9 @@ function get_distname() { ...@@ -89,7 +95,9 @@ function get_distname() {
$content = file_get_contents('/etc/redhat-release'); $content = file_get_contents('/etc/redhat-release');
if(stristr($content,'Fedora release 9 (Sulphur)')) { if(stristr($content,'Fedora release 9 (Sulphur)')) {
$distname = 'fedora9'; $distname = 'Fedora';
$distver = '9';
$distid = 'fedora9';
swriteln("Operating System: Fedora 9 or compatible\n"); swriteln("Operating System: Fedora 9 or compatible\n");
} }
...@@ -98,7 +106,7 @@ function get_distname() { ...@@ -98,7 +106,7 @@ function get_distname() {
die('unrecognized linux distribution'); die('unrecognized linux distribution');
} }
return $distname; return array('name' => $distname, 'version' => $distver, 'id' => $distid);
} }
function sread() { function sread() {
......
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