mirror of
https://github.com/unraid/webgui.git
synced 2026-05-04 08:49:47 -05:00
Plugin & Docker checks
This commit is contained in:
@@ -12,18 +12,22 @@
|
||||
*/
|
||||
?>
|
||||
<?
|
||||
// Multi-language support
|
||||
if (!function_exists('_')) {
|
||||
function _($text) {return $text;}
|
||||
}
|
||||
|
||||
session_start();
|
||||
$docroot = $docroot ?? $_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
|
||||
|
||||
require_once "$docroot/webGui/include/Wrappers.php";
|
||||
require_once "$docroot/plugins/dynamix.plugin.manager/include/PluginHelpers.php";
|
||||
|
||||
$var = parse_ini_file('/var/local/emhttp/var.ini');
|
||||
$current = parse_ini_file('/etc/unraid-version');
|
||||
$unraid = parse_plugin_cfg('dynamix', true);
|
||||
|
||||
// Multi-language support
|
||||
$_SESSION['locale'] = $unraid['display']['locale'];
|
||||
$_SERVER['REQUEST_URI'] = "scripts";
|
||||
require_once "$docroot/webGui/include/Translations.php";
|
||||
|
||||
|
||||
$current = parse_ini_file('/etc/unraid-version');
|
||||
$server = strtoupper($var['NAME']);
|
||||
$output = $unraid['notify']['plugin'];
|
||||
$builtin = ['unRAIDServer','unRAIDServer-'];
|
||||
@@ -41,7 +45,11 @@ foreach (glob("/$tmp/*.plg", GLOB_NOSORT) as $file) {
|
||||
$min = plugin('min', $file) ?: $current['version'];
|
||||
// silently suppress bad download of PLG file
|
||||
if (strcmp($new, $old)>0 && !version_compare($min,$current['version'],">")) {
|
||||
exec("$notify -e ".escapeshellarg("Plugin - $name [$new]")." -s ".escapeshellarg("Notice [$server] - Version update $new")." -d ".escapeshellarg("A new version of $name is available")." -i ".escapeshellarg("normal $output")." -x");
|
||||
// So that "'" doesn't show up in email
|
||||
$event = str_replace("'","'",_("Plugin")." - $name [$new]");
|
||||
$subject = str_replace("'","'",sprintf(_("Notice [%s] - Version update %s"),$server,$new));
|
||||
$description = str_replace("'","'",sprintf(_("A new version of %s is available"),$name));
|
||||
exec("$notify -e ".escapeshellarg($event)." -s ".escapeshellarg($subject)." -d ".escapeshellarg($description)." -i ".escapeshellarg("normal $output")." -x");
|
||||
}
|
||||
}
|
||||
exit(0);
|
||||
|
||||
Reference in New Issue
Block a user