aboutsummaryrefslogtreecommitdiff
path: root/admin/api/getUbuntuUpgrades.php
diff options
context:
space:
mode:
authorMinteck <46352972+Minteck@users.noreply.github.com>2021-08-01 22:28:15 +0200
committerMinteck <46352972+Minteck@users.noreply.github.com>2021-08-01 22:28:15 +0200
commit9852b6cd074cceec0d0b549bb6c9bd7fe50c86f2 (patch)
tree22d9b851864f9370282f21d10113afd5d565e4cf /admin/api/getUbuntuUpgrades.php
parentb028da9fea70c65ccd52d1d478859739027d756a (diff)
downloadmain-9852b6cd074cceec0d0b549bb6c9bd7fe50c86f2.tar.gz
main-9852b6cd074cceec0d0b549bb6c9bd7fe50c86f2.tar.bz2
main-9852b6cd074cceec0d0b549bb6c9bd7fe50c86f2.zip
Update
Diffstat (limited to 'admin/api/getUbuntuUpgrades.php')
-rw-r--r--admin/api/getUbuntuUpgrades.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/admin/api/getUbuntuUpgrades.php b/admin/api/getUbuntuUpgrades.php
new file mode 100644
index 0000000..dcf06ce
--- /dev/null
+++ b/admin/api/getUbuntuUpgrades.php
@@ -0,0 +1,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");
+} \ No newline at end of file