diff --git a/install/tpl/config.inc.php.master b/install/tpl/config.inc.php.master
index 3cfe1a509519b8061fe3343ca9fb65ed37b88939..d02ffd0660b2d316ce1b4c58cdf652a30f22c07d 100644
--- a/install/tpl/config.inc.php.master
+++ b/install/tpl/config.inc.php.master
@@ -108,6 +108,13 @@ define("DB_PASSWORD",$conf["db_password"]);
 $conf["log_file"]		= '/var/log/ispconfig/ispconfig.log';
 $conf["log_priority"]	= {ispconfig_log_priority}; // 0 = Debug, 1 = Warning, 2 = Error
 
+/*
+		Allow software package installations
+*/
+
+$conf['software_updates_enabled'] = false;
+
+
 /*
         Themes
 */
diff --git a/interface/web/admin/software_package_list.php b/interface/web/admin/software_package_list.php
index 2f632a6f8dc232d119061ae6051c21a399cf155d..19a7518a12fc177b4c769eb3e55e7bfb10243810 100644
--- a/interface/web/admin/software_package_list.php
+++ b/interface/web/admin/software_package_list.php
@@ -74,7 +74,8 @@ if(isset($_GET['action']) && $_GET['action'] == 'install' && $_GET['package'] !=
 	$tmp = $app->db->queryOneRecord($sql);
 	$software_update_id = $tmp['software_update_id'];
 	
-	$insert_data = "(package_name, server_id, software_update_id, status) VALUES ('$package_name', '$server_id', '$software_update_id','installing')";
+	// $insert_data = "(package_name, server_id, software_update_id, status) VALUES ('$package_name', '$server_id', '$software_update_id','installing')";
+	$insert_data = "(package_name, server_id, software_update_id, status) VALUES ('$package_name', '$server_id', '$software_update_id','installed')";
 	$app->db->datalogInsert('software_update_inst', $insert_data, 'software_update_inst_id');
 	
 }
diff --git a/interface/web/admin/software_update_list.php b/interface/web/admin/software_update_list.php
index 78cbbfe347381381ff63bfcebdd944eeabf9d9fc..d4255b76c6279582182355ba0d61dedd2db3dfc6 100644
--- a/interface/web/admin/software_update_list.php
+++ b/interface/web/admin/software_update_list.php
@@ -104,7 +104,8 @@ if(isset($_GET['action']) && $_GET['action'] == 'install' && $_GET['package'] !=
 	$server_id = intval($_GET['server_id']);
 	$software_update_id = intval($_GET['id']);
 	
-	$insert_data = "(package_name, server_id, software_update_id, status) VALUES ('$package_name', '$server_id', '$software_update_id','installing')";
+	// $insert_data = "(package_name, server_id, software_update_id, status) VALUES ('$package_name', '$server_id', '$software_update_id','installing')";
+	$insert_data = "(package_name, server_id, software_update_id, status) VALUES ('$package_name', '$server_id', '$software_update_id','installed')";
 	$app->db->datalogInsert('software_update_inst', $insert_data, 'software_update_inst_id');
 	
 }
diff --git a/server/plugins-available/software_update_plugin.inc.php b/server/plugins-available/software_update_plugin.inc.php
new file mode 100644
index 0000000000000000000000000000000000000000..0bc0081896ad0872ef1f17a0b953a74d3fa5476f
--- /dev/null
+++ b/server/plugins-available/software_update_plugin.inc.php
@@ -0,0 +1,119 @@
+<?php
+
+/*
+Copyright (c) 2008, Till Brehm, projektfarm Gmbh
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright notice,
+      this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright notice,
+      this list of conditions and the following disclaimer in the documentation
+      and/or other materials provided with the distribution.
+    * Neither the name of ISPConfig nor the names of its contributors
+      may be used to endorse or promote products derived from this software without
+      specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+class software_update_plugin {
+	
+	var $plugin_name = 'software_update_plugin';
+	var $class_name  = 'software_update_plugin';
+	
+		
+	/*
+	 	This function is called when the plugin is loaded
+	*/
+	
+	function onLoad() {
+		global $app;
+		
+		/*
+		Register for the events
+		*/
+		
+		//* Mailboxes
+		$app->plugins->registerEvent('software_update_inst_insert',$this->plugin_name,'process');
+		//$app->plugins->registerEvent('software_update_inst_update',$this->plugin_name,'process');
+		//$app->plugins->registerEvent('software_update_inst_delete',$this->plugin_name,'process');
+		
+		
+	}
+	
+	
+	function process($event_name,$data) {
+		global $app, $conf;
+		
+		if(!$conf['software_updates_enabled'] == true) {
+			$app->log('Software Updates not eanbled on this server. To enable updates, set $conf["software_updates_enabled"] = true; in config.inc.php',LOGLEVEL_ERROR);
+			return false;
+		}
+		
+		//* Get the info of the package:
+		$software_update_id = intval($data["new"]["software_update_id"]);
+		$software_update = $app->db->queryOneRecord("SELECT * FROM software_update WHERE software_update_id = '$software_update_id'");
+		
+		$temp_dir = '/tmp/'.md5 (uniqid (rand()));
+		$app->log("The temp dir is $temp_dir",LOGLEVEL_DEBUG);
+		mkdir($temp_dir);
+		if(!is_dir($temp_dir)) {
+			$app->log("Unable to create temp directory.",LOGLEVEL_ERROR);
+			return false;
+		}
+		
+		exec("cd $temp_dir && wget ".$software_update["update_url"]);
+		$app->log("Downloading the update file from: ".$software_update["update_url"],LOGLEVEL_DEBUG);
+		
+		$url_parts = parse_url($software_update["update_url"]);
+		$update_filename = basename($url_parts["path"]);
+		$app->log("The update filename is $update_filename",LOGLEVEL_DEBUG);
+		
+		if(is_file($temp_dir.'/'.$update_filename)) {
+			
+			//* Checking the md5sum
+			if(md5_file($temp_dir.'/'.$update_filename) != $software_update["update_md5"]) {
+				$app->log("The md5 sum of the downloaded file is incorrect. Update aborted.",LOGLEVEL_ERROR);
+				exec("rm -rf $temp_dir");
+				$app->log("Deleting the temp directory $temp_dir",LOGLEVEL_DEBUG);
+				return false;
+			}
+			
+			
+			//* unpacking the update
+			exec("cd $temp_dir && unzip $update_filename");
+			
+			if(is_file($temp_dir.'/setup.sh')) {
+				// Execute the setup script
+				exec('chmod +x '.$temp_dir.'/setup.sh');
+				$app->log("Executing setup.sh file in directory $temp_dir",LOGLEVEL_DEBUG);
+				exec('cd '.$temp_dir.' && ./setup.sh');
+				$app->db->query("UPDATE software_update_inst SET status = 'installed' WHERE software_update_inst_id = ".$data["new"]["software_update_inst_id"]);
+			} else {
+				$app->log("setup.sh file not found",LOGLEVEL_ERROR);
+			}
+		} else {
+			$app->log("Download of the update file failed",LOGLEVEL_ERROR);
+		}
+		
+		exec("rm -rf $temp_dir");
+		$app->log("Deleting the temp directory $temp_dir",LOGLEVEL_DEBUG);
+		
+	}
+	
+
+} // end class
+
+?>
\ No newline at end of file