Add api to check if the server needs a reboot

This commit is contained in:
Johannes Zellner
2018-11-25 17:02:01 +01:00
parent 802011bb7e
commit cb6699eeed
3 changed files with 19 additions and 1 deletions

View File

@@ -2,6 +2,7 @@
exports = module.exports = {
reboot: reboot,
isRebootRequired: isRebootRequired,
getConfig: getConfig,
getDisks: getDisks,
getUpdateInfo: getUpdateInfo,
@@ -38,6 +39,14 @@ function reboot(req, res, next) {
cloudron.reboot(function () { });
}
function isRebootRequired(req, res, next) {
cloudron.isRebootRequired(function (error, result) {
if (error) return next(new HttpError(500, error));
next(new HttpSuccess(200, { rebootRequired: result }));
});
}
function getConfig(req, res, next) {
cloudron.getConfig(function (error, cloudronConfig) {
if (error) return next(new HttpError(500, error));