aboutsummaryrefslogtreecommitdiff
path: root/admin/api/getUbuntuUpgrades.php
blob: 7da62592bceebe879f94b43740603747a21b012f (plain)
1
2
3
4
5
6
7
8
9
10
<?php

require_once $_SERVER['DOCUMENT_ROOT'] . "/admin/private/header.api.php";

exec("bash -c \"sudo do-release-upgrade -c | grep 'New release'\"", $ret);
if (count($ret) === 1) {
    echo("<b>Ubuntu " . explode("'", $ret[0])[1] . "</b> is available, use <code>do-release-upgrade</code> to upgrade");
} else {
    echo("This server is running the latest version of Ubuntu");
}