Merge pull request #128 from bergware/6.4-wip

Make bootmode script executable
This commit is contained in:
tom mortensen
2017-06-21 00:41:14 -07:00
committed by GitHub
3 changed files with 6 additions and 15 deletions

View File

@@ -21,13 +21,8 @@ function plugin($method, $arg = '') {
}
function check_plugin($arg, $google='8.8.8.8') {
$inet = 3;
// ping google DNS server first to ensure internet is present
while (1) {
if (exec("ping -qnc1 $google|awk '/received/{print $4}'")==1) break;
$inet--;
if (!$inet) break;
}
// ping google DNS server first to ensure internet is present
$inet = exec("ping -qnc2 -i0.2 $google|awk '/received/{print $4}'");
return $inet ? plugin('check',$arg) : false;
}

View File

@@ -16,7 +16,6 @@ require_once "$docroot/webGui/include/Markdown.php";
require_once "$docroot/plugins/dynamix.plugin.manager/include/PluginHelpers.php";
$current = parse_ini_file('/etc/unraid-version');
$stale = $_GET['stale'] ?? false;
$release = $_GET['release'] ?? false;
$system = $_GET['system'] ?? false;
$empty = true;
@@ -35,7 +34,7 @@ foreach (glob("/var/log/plugins/*.plg",GLOB_NOSORT) as $plugin_link) {
//switch between system and custom plugins
if (($system && !$custom) || (!$system && $custom)) continue;
//forced plugin check
check_plugin("$name.plg");
$checked = check_plugin("$name.plg");
//OS update?
$os = $system && $name==$builtin[0];
$toggle = false;
@@ -73,12 +72,12 @@ foreach (glob("/var/log/plugins/*.plg",GLOB_NOSORT) as $plugin_link) {
//category
$cat = strpos($version,'rc')!==false ? 'next' : 'stable';
//status
$status = 'no update';
$status = 'unknown';
$changes_file = $plugin_file;
$URL = plugin('pluginURL',$plugin_file);
if ($URL !== false) {
$filename = "/tmp/plugins/".(($os && $release) ? $tmp_plg : basename($URL));
if (file_exists($filename)) {
if ($checked && file_exists($filename)) {
if ($toggle && $toggle != $version) {
$status = make_link('install',$plugin_file,'forced');
} else {
@@ -96,10 +95,7 @@ foreach (glob("/var/log/plugins/*.plg",GLOB_NOSORT) as $plugin_link) {
$status = "up-to-date";
}
}
} else {
if ($stale) $status = "unknown";
}
$nofetch |= ($status == 'no update');
} else $nofetch = true;
}
$changes = plugin('changes',$changes_file);
if ($changes !== false) {

0
plugins/dynamix/scripts/bootmode Normal file → Executable file
View File