mirror of
https://github.com/unraid/webgui.git
synced 2026-04-24 11:19:25 -05:00
merge ronalds changes from upstream + some vm and dashboard fixes
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/php
|
||||
#!/usr/bin/php -q
|
||||
<?PHP
|
||||
/* Copyright 2015, Bergware International.
|
||||
* Copyright 2015, Lime Technology
|
||||
@@ -12,13 +12,12 @@
|
||||
*/
|
||||
?>
|
||||
<?
|
||||
require_once('/usr/local/emhttp/webGui/include/Wrappers.php');
|
||||
require_once '/usr/local/emhttp/webGui/include/Wrappers.php';
|
||||
exec("wget -qO /dev/null 127.0.0.1:$(lsof -lbnPi4 -sTCP:LISTEN|grep -Pom1 '^emhttp.*:\K[\d]+')/update.htm?cmdStatus=apply");
|
||||
|
||||
$current = parse_ini_file('/etc/unraid-version');
|
||||
$notify = "/usr/local/emhttp/webGui/scripts/notify";
|
||||
$plugin = "/usr/local/emhttp/plugins/dynamix.plugin.manager/scripts/plugin";
|
||||
|
||||
exec("wget -qO /dev/null 127.0.0.1:$(lsof -lbnPi4 -sTCP:LISTEN|grep -Pom1 '^emhttp .*TCP[^\d]+\K\d+')/update.htm?cmdStatus=apply");
|
||||
|
||||
$var = parse_ini_file("/var/local/emhttp/var.ini");
|
||||
$unraid = parse_plugin_cfg("dynamix",true);
|
||||
$server = strtoupper($var['NAME']);
|
||||
@@ -30,12 +29,16 @@ foreach (glob("/tmp/plugins/*.plg", GLOB_NOSORT) as $file) {
|
||||
$old = exec("$plugin version '/var/log/plugins/$plg'");
|
||||
unset($new);
|
||||
exec("$plugin version '$file'", $new, $error);
|
||||
// Silently suppress bad download of PLG file
|
||||
// silently suppress bad download of PLG file
|
||||
if ($error) continue;
|
||||
$new = $new[0];
|
||||
if (strcmp($new, $old) > 0) {
|
||||
$name = basename($file, '.plg');
|
||||
exec("$notify -e 'Plugin - $name [$new]' -s 'Notice [$server] - Version update $new' -d 'A new version of $name is available' -i 'normal $output' -x");
|
||||
exec("$plugin unRAID '$file'", $unRAID);
|
||||
$unRAID = $unRAID[0];
|
||||
if (empty($unRAID) || strcmp($current['version'], $unRAID) >= 0) {
|
||||
$name = basename($file, '.plg');
|
||||
exec("$notify -e 'Plugin - $name [$new]' -s 'Notice [$server] - Version update $new' -d 'A new version of $name is available' -i 'normal $output' -x");
|
||||
}
|
||||
}
|
||||
}
|
||||
exit(0);
|
||||
|
||||
Reference in New Issue
Block a user