From 0711af043c1f07525490b0d3b642463c47462076 Mon Sep 17 00:00:00 2001 From: tbrehm <t.brehm@ispconfig.org> Date: Wed, 03 Sep 2008 13:52:26 -0400 Subject: [PATCH] - Added support for Fedora 9 --- install/lib/install.lib.php | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 54 insertions(+), 2 deletions(-) diff --git a/install/lib/install.lib.php b/install/lib/install.lib.php index 78ef578..aad7b4a 100644 --- a/install/lib/install.lib.php +++ b/install/lib/install.lib.php @@ -84,8 +84,16 @@ //** Redhat - elseif(file_exists("/etc/redhat_release")) { - + elseif(file_exists("/etc/redhat-release")) { + + $content = file_get_contents('/etc/redhat-release'); + + if(stristr($content,'Fedora release 9 (Sulphur)')) { + $distname = 'fedora9'; + swriteln("Operating System: Fedora 9 or compatible\n"); + } + + } else { die('unrecognized linux distribution'); } @@ -481,6 +489,50 @@ return false; } +function replaceLine($filename,$search_pattern,$new_line,$strict = 0) { + $lines = file($filename); + $out = ''; + $found = 0; + foreach($lines as $line) { + if($strict == 0) { + if(stristr($line,$search_pattern)) { + $out .= $new_line."\n"; + $found = 1; + } else { + $out .= $line; + } + } else { + if(trim($line) == $search_pattern) { + $out .= $new_line."\n"; + $found = 1; + } else { + $out .= $line; + } + } + } + if($found == 0) { + $out .= $new_line."\n"; + } + file_put_contents($filename,$out); +} + +function removeLine($filename,$search_pattern,$strict = 0) { + $lines = file($filename); + $out = ''; + foreach($lines as $line) { + if($strict == 0) { + if(!stristr($line,$search_pattern)) { + $out .= $line; + } + } else { + if(!trim($line) == $search_pattern) { + $out .= $line; + } + } + } + file_put_contents($filename,$out); +} + ?> \ No newline at end of file -- Gitblit v1.9.1