| | |
| | | /*
|
| | | * process all actions
|
| | | */
|
| | | foreach ($actions as $action) {
|
| | | if ($action['action_type'] == 'os_update') {
|
| | | /* do the update */
|
| | | $this->_doOsUpdate($action);
|
| | | /* this action takes so much time,
|
| | | * we stop executing the actions not to waste more time */
|
| | | return;
|
| | | }
|
| | | if ($action['action_type'] == 'ispc_update') {
|
| | | /* do the update */
|
| | | $this->_doIspCUpdate($action);
|
| | | /* this action takes so much time,
|
| | | * we stop executing the actions not to waste more time */
|
| | | return;
|
| | | if(is_array($actions)) {
|
| | | foreach ($actions as $action) {
|
| | | if ($action['action_type'] == 'os_update') {
|
| | | /* do the update */
|
| | | $this->_doOsUpdate($action);
|
| | | /* this action takes so much time,
|
| | | * we stop executing the actions not to waste more time */
|
| | | return;
|
| | | }
|
| | | if ($action['action_type'] == 'ispc_update') {
|
| | | /* do the update */
|
| | | $this->_doIspCUpdate($action);
|
| | | /* this action takes so much time,
|
| | | * we stop executing the actions not to waste more time */
|
| | | return;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | * Do the update
|
| | | */
|
| | | exec("aptitude update");
|
| | | exec("aptitude upgrade -y");
|
| | | exec("aptitude safe-upgrade -y");
|
| | |
|
| | | //TODO : change this when distribution information has been integrated into server record
|
| | | if(file_exists('/etc/gentoo-release')) {
|
| | | exec("glsa-check -f --nocolor affected");
|
| | | }
|
| | | else {
|
| | | exec("aptitude update");
|
| | | exec("aptitude safe-upgrade -y");
|
| | | }
|
| | | |
| | | /*
|
| | | * All well done!
|
| | | */
|
| | |
| | | }
|
| | |
|
| | | private function _doIspCUpdate($action) {
|
| | | |
| | | // Ensure that this code is not executed twice as this would cause a loop in case of a failure
|
| | | $this->_actionDone($action['action_id'], 'ok');
|
| | | |
| | | /*
|
| | | * Get the version-number of the newest version
|
| | | */
|
| | |
| | | exec("tar xvfz ISPConfig-" . $new_version . ".tar.gz");
|
| | |
|
| | | /*
|
| | | * Start the automated update
|
| | | * Initialize the automated update
|
| | | * (the update is then done next start of server.sh
|
| | | */
|
| | | 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"
|
| | |
| | | /*
|
| | | * All well done!
|
| | | */
|
| | | $this->_actionDone($action['action_id'], 'ok');
|
| | | //$this->_actionDone($action['action_id'], 'ok');
|
| | | }
|
| | | }
|
| | | ?> |