File tree Expand file tree Collapse file tree 1 file changed +25
-1
lines changed
Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -142,28 +142,52 @@ private function _doOsUpdate($action) {
142142 }
143143
144144 private function _doIspCUpdate ($ action ) {
145+ /*
146+ * Get the version-number of the newest version
147+ */
145148 $ new_version = @file_get_contents ('http://www.ispconfig.org/downloads/ispconfig3_version.txt ' );
146149 $ new_version = trim ($ new_version );
150+
147151 /*
148152 * Do the update
149153 */
154+
155+ /* jump into the temporary dir */
150156 $ oldDir = getcwd ();
151157 chdir ("/tmp " );
152158
159+ /* delete the old files (if there are any...) */
153160 exec ("rm /tmp/ISPConfig- " . $ new_version . ".tar.gz " );
154161 exec ("rm /tmp/ispconfig3_install -R " );
162+
163+ /* get the newest version */
155164 exec ("wget http://www.ispconfig.org/downloads/ISPConfig- " . $ new_version . ".tar.gz " );
165+
166+ /* extract the files */
156167 exec ("tar xvfz ISPConfig- " . $ new_version . ".tar.gz " );
157168
169+ /*
170+ * Start the automated update
171+ */
158172 chdir ("/tmp/ispconfig3_install/install " );
159173 exec ("touch autoupdate " );
160174 exec ("php -q autoupdate.php " );
161175
176+ /*
177+ * do some clean-up
178+ */
179+ exec ("rm /tmp/ISPConfig- " . $ new_version . ".tar.gz " );
180+ exec ("rm /tmp/ispconfig3_install -R " );
181+
182+ /*
183+ * go back to the "old path"
184+ */
185+ chdir ($ oldDir );
186+
162187 /*
163188 * All well done!
164189 */
165190 $ this ->_actionDone ($ action ['action_id ' ], 'ok ' );
166191 }
167-
168192}
169193?>
You can’t perform that action at this time.
0 commit comments