mirror of
https://github.com/unraid/webgui.git
synced 2026-04-23 18:48:49 -05:00
Use PHP version_compare to check Unraid versions
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/php -q
|
||||
<?PHP
|
||||
/* Copyright 2005-2017, Lime Technology
|
||||
* Copyright 2012-2017, Bergware International.
|
||||
/* Copyright 2005-2018, Lime Technology
|
||||
* Copyright 2012-2018, Bergware International.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License version 2,
|
||||
@@ -31,7 +31,7 @@ foreach ($builtin as $name) {
|
||||
$old = plugin('version', "/var/log/plugins/$plg");
|
||||
$new = plugin('version', $file);
|
||||
// silently suppress bad download of PLG file
|
||||
if (strcmp($new, $old) > 0) {
|
||||
if (version_compare($new,$old,'>')) {
|
||||
exec("$notify -e ".escapeshellarg("System - $name [$new]")." -s ".escapeshellarg("Notice [$server] - Version update $new")." -d ".escapeshellarg("A new version of $name is available")." -i ".escapeshellarg("normal $output")." -x");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user