Merge pull request #803 from Squidly271/patch-9

Plugins: Move incompatible plugins to ../plugins-error
This commit is contained in:
tom mortensen
2021-03-13 11:10:35 -08:00
committed by GitHub

View File

@@ -1,6 +1,6 @@
#!/usr/bin/php -q
<?PHP
// Copyright 2005-2020, Lime Technology
// Copyright 2005-2021, Lime Technology
// License: GPLv2 only
//
// Program updates made by Bergware International (April 2020)
@@ -465,12 +465,18 @@ if ($method == 'install') {
$min = plugin('min', $plugin_file, $error);
if ($min && version_compare($unraid['version'], $min, '<')) {
echo "plugin: installed Unraid version is too low, require at least version $min\n";
if (dirname($plugin_file) == "$boot") {
move($plugin_file, "$boot-error");
}
exit(1);
}
$max = plugin('max', $plugin_file, $error);
if (empty($max)) $max = plugin('Unraid', $plugin_file, $error);
if ($max && version_compare($unraid['version'], $max, '>')) {
echo "plugin: installed Unraid version is too high, require at most version $max\n";
if (dirname($plugin_file) == "$boot") {
move($plugin_file, "$boot-error");
}
exit(1);
}
$plugin = basename($plugin_file);