From 1865cf7c0c1ca8720bb947a67675af1f1e19b653 Mon Sep 17 00:00:00 2001 From: vogelor <vogelor@ispconfig3> Date: Fri, 4 Jun 2010 11:52:06 +0000 Subject: [PATCH] Fixed some bug in remote-action ISPConfig - Update --- .../remoteaction_core_module.inc.php | 26 ++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/server/mods-available/remoteaction_core_module.inc.php b/server/mods-available/remoteaction_core_module.inc.php index 1c4e54e99d..e5e8868dac 100644 --- a/server/mods-available/remoteaction_core_module.inc.php +++ b/server/mods-available/remoteaction_core_module.inc.php @@ -142,28 +142,52 @@ class remoteaction_core_module { } private function _doIspCUpdate($action) { + /* + * Get the version-number of the newest version + */ $new_version = @file_get_contents('http://www.ispconfig.org/downloads/ispconfig3_version.txt'); $new_version = trim($new_version); + /* * Do the update */ + + /* jump into the temporary dir */ $oldDir = getcwd(); chdir("/tmp"); + /* delete the old files (if there are any...) */ exec("rm /tmp/ISPConfig-" . $new_version . ".tar.gz"); exec("rm /tmp/ispconfig3_install -R"); + + /* get the newest version */ exec("wget http://www.ispconfig.org/downloads/ISPConfig-" . $new_version . ".tar.gz"); + + /* extract the files */ exec("tar xvfz ISPConfig-" . $new_version . ".tar.gz"); + /* + * Start the automated update + */ chdir("/tmp/ispconfig3_install/install"); exec("touch autoupdate"); exec("php -q autoupdate.php"); + /* + * do some clean-up + */ + exec("rm /tmp/ISPConfig-" . $new_version . ".tar.gz"); + exec("rm /tmp/ispconfig3_install -R"); + + /* + * go back to the "old path" + */ + chdir($oldDir); + /* * All well done! */ $this->_actionDone($action['action_id'], 'ok'); } - } ?> \ No newline at end of file -- GitLab