From 3e8065da6afcd47bfc97fdb6b8dcc3b14e02c86d Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Mon, 09 Jun 2008 11:50:31 -0400
Subject: [PATCH] Copy jailkit config files only if the jailkit config directory exists.
---
install/lib/install.lib.php | 42 ++++++++++++++++++++++++++++++------------
1 files changed, 30 insertions(+), 12 deletions(-)
diff --git a/install/lib/install.lib.php b/install/lib/install.lib.php
index 326067f..b8f40f1 100644
--- a/install/lib/install.lib.php
+++ b/install/lib/install.lib.php
@@ -56,15 +56,34 @@
$FILE = realpath('../install.php');
+//** Get distribution identifier
function get_distname() {
- $distname = $conf['distname'];
+
+ $distname = '';
+
+ //** Debian or Ubuntu
+ if(file_exists('/etc/debian_version')) {
+
+ if(trim(file_get_contents('/etc/debian_version')) == '4.0') {
+ $distname = 'debian40';
+ swriteln("Operating System: Debian 4.0 or compatible\n");
+ }
+ if(trim(file_get_contents('/etc/debian_version')) == 'lenny/sid') {
+ $distname = 'debian40';
+ swriteln("Operating System: Debian Lenny/Sid or compatible\n");
+ }
+ }
+
+ //** Redhat
+ elseif(file_exists("/etc/redhat_release")) {
+
+ }
+
return $distname;
}
function sread() {
- $fp=fopen('/dev/stdin', 'r');
- $input=fgets($fp, 255);
- fclose($fp);
+ $input = fgets(STDIN);
return rtrim($input);
}
@@ -77,8 +96,7 @@
}
function ilog($msg){
- $logfile = '/var/log/ispconfig_install.log';
- exec("echo `date` \"- [ISPConfig] - \"".$msg." >> ".$logfile);
+ exec("echo `date` \"- [ISPConfig] - \"".$msg." >> ".ISPC_LOG_FILE);
}
function error($msg){
@@ -118,7 +136,7 @@
}
function mkdirs($strPath, $mode = '0755'){
- if(isset($strPath) && $strPath != ""){
+ if(isset($strPath) && $strPath != ''){
//* Verzeichnisse rekursiv erzeugen
if(is_dir($strPath)){
return true;
@@ -235,17 +253,17 @@
$lines = explode("\n", $inhalt);
if(!empty($lines)){
foreach($lines as $line){
- if(stristr($line, "include ")){
- $include_file = str_replace("\n", "", trim(shell_exec("echo \"$line\" | awk '{print \$2}'")));
- if(substr($include_file,0,1) != "/"){
- $include_file = $httpd_root."/".$include_file;
+ if(stristr($line, 'include ')){
+ $include_file = str_replace("\n", '', trim(shell_exec("echo \"$line\" | awk '{print \$2}'")));
+ if(substr($include_file,0,1) != '/'){
+ $include_file = $httpd_root.'/'.$include_file;
}
if(is_file($include_file)){
if($further_includes = find_includes($include_file)){
$includes = array_merge($includes, $further_includes);
}
} else {
- if(strstr($include_file, "*")){
+ if(strstr($include_file, '*')){
$more_files = explode("\n", shell_exec("ls -l $include_file | awk '{print \$9}'"));
if(!empty($more_files)){
foreach($more_files as $more_file){
--
Gitblit v1.9.1