Exemple #1
0
 public function do_upgrade()
 {
     $request = $this->getRequest();
     if ($request->isPost()) {
         $updater = new Updater();
         if ($updater->updateAvailable()) {
             $image_data = $updater->downloadLatest();
             if (!$updater->validateSignature($image_data)) {
                 die('INVALID SIGNATURE');
             }
             if ($updater->performUpdate($image_data)) {
                 die('Upgrading, please wait for the device to reboot.');
             } else {
                 die('FAILED');
             }
         }
     }
 }
 public function do_upgrade()
 {
     $request = $this->getRequest();
     if ($request->isPost()) {
         $updater = new Updater();
         if ($updater->updateAvailable()) {
             if (!$updater->validateSignature()) {
                 $updater->deleteImage();
                 die('INVALID SIGNATURE');
             }
             //die('SUCCESS'); # ENABLE TO DEBUG!
             if ($updater->performUpdate()) {
                 die('SUCCESS');
             } else {
                 die('FAILURE');
             }
         }
     }
 }