Skip to content

Instantly share code, notes, and snippets.

@ljm42
Last active September 11, 2023 20:55
Show Gist options
  • Save ljm42/83f41014c871f237c93c5a805086e30f to your computer and use it in GitHub Desktop.
Save ljm42/83f41014c871f237c93c5a805086e30f to your computer and use it in GitHub Desktop.
The Bleeding Edge Toolkit for Unraid. Allows you update your system with the latest unreleased webui code.
#!/usr/bin/php
<?PHP
error_reporting(E_STRICT | E_ALL);
ini_set('display_errors', '1');
/*
bleeding_edge_toolkit Copyright 2018-2023, ljm42
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License version 2,
as published by the Free Software Foundation.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
the latest version of this script can be found here:
https://gist.github.com/ljm42/83f41014c871f237c93c5a805086e30f
### ABOUT ###
This script lets you apply patches to your Unraid webui directly from GitHub.
You specify which patches to install, and this will reinstall them on every reboot.
This is not provided as a full solution. You need to modify the code below to download and install the specific patches you want.
More caveats: https://forums.unraid.net/topic/48707-additional-scripts-for-userscripts-plugin/?page=7&tab=comments#comment-640443
Features:
* Uses the patch command to process GitHub patches (both PRs and commits)
* Automatically downloads binary files (such as images), which the patch command does not process
* Guards against running the same patch twice
* Sets appropriate permissions (as specified in the patch) on new files
* Logs results in /tmp/bleeding_edge_toolkit/log-[datetime].txt for later review
### INSTALLATION ###
* Install the User Scripts plugin in Unraid, then Add New Script called "bleeding_edge_toolkit" and paste this script there.
* Modify the script to install the patches you want.
* Run the script manually until you are happy with your modifications, then schedule it to run at "first array start only"
* Note: to "uninstall" a patch, comment it out below and then reboot.
TODO: request way to have this run at boot instead of first array start
*/
// pass in the message to be logged
// this will "echo" the message, and append it to the $logHandle
// note: opening/closing the $logHandle is done elsewhere
function logger($msg)
{
global $logHandle;
echo $msg . PHP_EOL;
if (is_resource($logHandle)) {
fwrite($logHandle, $msg . PHP_EOL);
}
}
// pass in a .patch url (either a PR or a commit) from a github webui repo
// this will process the results with the "patch" command, download or delete binary files, and fix permissions on new files
function applyPatch($remote)
{
global $gitRoot, $patchDir;
preg_match('@(https://github.com)/([^/]*)/([^/]*)/(pull|commit)/([^\.]*)(\.patch)@', $remote, $remoteParts);
if (!$remoteParts) {
logger("invalid patch url, expecting link to PR or commit, followed by .patch ( {$remote} )");
return;
}
$patchFile = $patchDir . str_replace('/', '_', str_replace(':', '_', $remote));
if (file_exists($patchFile)) {
logger("patch already applied ( {$remote} )");
return;
}
// download the patch file
$contentArr = @file($remote);
if ($contentArr) {
if ($gitRoot == '/usr/local/') {
// fix patches that were started before the webgui reorg
// references to a/plugins/... become a/emhttp/plugins...
$contentArr = preg_replace('@diff --git a(/plugins/.*) b(/plugins/.*)@', 'diff --git a/emhttp${1} b/emhttp${2}', $contentArr);
$contentArr = preg_replace('@--- a(/plugins/.*)@', '--- a/emhttp${1}', $contentArr);
$contentArr = preg_replace('@\+\+\+ b(/plugins/.*)@', '+++ b/emhttp${1}', $contentArr);
$contentArr = preg_replace('@( create mode 100\d\d\d )(plugins\/.*)@', '${1}emhttp/${2}', $contentArr);
$contentArr = preg_replace('@( mode change 100\d\d\d => 100\d\d\d )(plugins\/.*)@', '${1}emhttp/${2}', $contentArr);
// note: only updates paths in the 'plugins' folder. PRs that update 'languages' or files in the old root will need additional processing
// note: not all paths in the patch file are updated, so it is not internally consistent after this. seems to be enough for the patch to work though.
}
file_put_contents($patchFile, implode("", $contentArr));
} else {
logger("unable to download ( {$remote} )");
return;
}
// loop through patchFile, generate array of files changed and which commit they were changed in
// the commit string is needed to download binary files
$filesArr = [];
$thisCommit = "";
foreach ($contentArr as $line) {
// From 04ec6d8cc825250d4a4926cc7478bdb571521b31 Mon Sep 17 00:00:00 2001
preg_match('@From ([^ ]*) (... ... .. ..:..:.. ....)@', $line, $matches1);
if ($matches1) {
$thisCommit = $matches1[1];
continue;
}
// diff --git a/plugins/dynamix.vm.manager/icons/addvm.png b/plugins/dynamix.vm.manager/icons/addvm.png
preg_match('@diff --git a/(.*) b/(.*)@', $line, $matches2);
if ($matches2) {
$thisFile = $matches2[1];
$filesArr[$thisFile] = $thisCommit;
}
}
// apply the patch file, then process each line of the output
logger("about to apply patch ( {$remote} )");
$execCmd = "patch -p 1 -d \"{$gitRoot}\" -i \"{$patchFile}\"";
exec($execCmd, $execOutputArr, $execReturn);
foreach ($execOutputArr as $outputLine) {
// handle binary files
preg_match('@File (.*): git binary diffs are not supported.@', $outputLine, $matches);
if ($matches) {
$file = $matches[1];
$commit = $filesArr[$file];
// binary downloads in this format: https://github.com/limetech/webgui/raw/e6630c2ad707d5104516d6469c513573651aa3d7/plugins/dynamix.vm.manager/novnc/app/images/icons/novnc-120x120.png
$binaryUrlRoot = $remoteParts[1] . '/' . $remoteParts[2] . '/' . $remoteParts[3] . '/raw/' . $commit . '/';
downloadOrDelete($binaryUrlRoot, $file);
} else {
// just output the line
logger("- {$outputLine}");
}
}
// set perms on new files as specified by patch file
$newFiles = preg_grep("/^ create mode /", $contentArr);
foreach ($newFiles as $newFile) {
preg_match('@ create mode 100([4567][4567][4567]) (.*)@', $newFile, $matches);
if ($matches) {
$mode = $matches[1];
$file = $matches[2];
setPerms($file, $mode);
} else {
logger("--- unexpected mode ( {$newFile} )");
}
}
// change mode on files as specified by patch file
$newModes = preg_grep("/^ mode change /", $contentArr);
foreach ($newModes as $newMode) {
preg_match('@ mode change 100\d\d\d => 100([4567][4567][4567]) (.*)@', $newMode, $matches);
if ($matches) {
$mode = $matches[1];
$file = $matches[2];
setPerms($file, $mode);
} else {
logger("--- unexpected mode ( {$newMode} )");
}
}
// handle helptext.txt/dot
if (array_key_exists('languages/en_US/helptext.txt', $filesArr) || array_key_exists('emhttp/languages/en_US/helptext.txt', $filesArr)) {
logger("--- helptext.txt was updated, deleting helptext.dot so it will be regenerated");
@unlink('/usr/local/emhttp/languages/en_US/helptext.dot');
}
logger(PHP_EOL);
}
// pass in mode as decimal
function setPerms($file, $decmode)
{
global $gitRoot;
$octmode = octdec($decmode);
if (!file_exists($file)) {
$file = $gitRoot . $file;
}
if (!file_exists($file)) {
logger("--- $file does not exist, unable to set perms");
} elseif (@chmod($file, $octmode)) {
logger("--- set perms $decmode on $file");
} else {
logger("--- unable to set perms $decmode on $file");
}
}
function makeSymlink($target, $link)
{
if (!is_link($link)) {
symlink($target, $link);
logger("--- created symlink $link");
}
}
// called by applyPatch() to process binary files
// if $file exists at the $binaryUrlRoot url provided, it will be downloaded and placed on the $local file system
// if the $file does not exist at the $binaryUrlRoot url provided, the $local version will be deleted
function downloadOrDelete($binaryUrlRoot, $file)
{
global $gitRoot;
$local = $gitRoot . $file;
$remote = $binaryUrlRoot . $file;
$content = @file_get_contents($remote);
if ($content) {
if (file_put_contents($local, $content) !== false) {
logger("-- replaced binary file $file");
} else {
logger("-- skipped binary file $file");
}
} else {
// file not at this url, assume this patch deleted it
@unlink($local);
logger("-- deleted binary file $file");
}
}
// begin script
$gitRoot = '/usr/local/';
$patchDir = '/tmp/bleeding_edge_toolkit/';
$unraid = parse_ini_file('/etc/unraid-version');
// open log file
@mkdir($patchDir, 0777, true);
$logFile = $patchDir . 'log-' . @date('Ymd-His') . '.txt';
$logHandle = fopen($logFile, 'a') or exit("Can't open $logFile" . "\n");
logger('logfile: ' . $logFile);
logger('Unraid version ' . $unraid['version']);
///////////////////////////
// Begin customizations here
// Note that it is up to you to make sure the patches you install are compatible with your version of Unraid.
// The code below is just an example. You need to decide which patches you are comfortable installing.
//
// If a patch gives errors on merge, that means you need to install previous patches first
// Note that some webui patches require corresponding changes to the Unraid back end, and will not work until you upgrade
if ($unraid['version'] == '6.12.0-beta6' && file_exists('/tmp/bleeding_edge_toolkit/https___github.com_limetech_webgui_pull_1227.patch')) {
// "fake" beta6 detected, process as beta5
$unraid['version'] = '6.12.0-beta5';
logger('..resetting to ' . $unraid['version']);
}
switch ($unraid['version']) {
case 'test':
$gitRoot = '/usr/local/emhttp/';
// for some reason, github does not have a .patch file for this patch
applyPatch('https://github.com/limetech/webgui/pull/244.patch');
// PR with new image file. patch can create it natively
applyPatch('https://github.com/limetech/webgui/pull/156.patch');
// PR with binary patch (from another package)
// https://github.com/beetbox/beets/pull/2552.patch
break;
case '6.7.0-rc3':
$gitRoot = '/usr/local/emhttp/';
applyPatch('https://github.com/limetech/webgui/pull/462.patch');
break;
case '6.7.0-rc4':
$gitRoot = '/usr/local/emhttp/';
$badfile = '/usr/local/emhttp/tics: dynamic file name creation';
if (file_exists($badfile)) {
unlink($badfile);
logger("- deleted $badfile");
}
applyPatch('https://github.com/limetech/webgui/pull/463.patch');
applyPatch('https://github.com/limetech/webgui/pull/464.patch');
break;
case '6.9.2':
$gitRoot = '/usr/local/emhttp/';
applyPatch('https://github.com/limetech/webgui/pull/824.patch');
applyPatch('https://github.com/limetech/webgui/pull/825.patch');
applyPatch('https://github.com/limetech/webgui/pull/827.patch');
applyPatch('https://github.com/limetech/webgui/pull/828.patch');
applyPatch('https://github.com/limetech/webgui/pull/829.patch');
applyPatch('https://github.com/limetech/webgui/pull/830.patch');
// applyPatch('https://github.com/limetech/webgui/pull/831.patch');
applyPatch('https://github.com/limetech/webgui/pull/837.patch');
break;
case '6.11.0-beta5':
$gitRoot = '/usr/local/emhttp/';
applyPatch('https://github.com/limetech/webgui/pull/1130.patch');
break;
case '6.11.2-rc1':
$gitRoot = '/usr/local/emhttp/';
applyPatch('https://github.com/limetech/webgui/pull/1173.patch');
break;
case '6.11.3':
$gitRoot = '/usr/local/emhttp/';
applyPatch('https://github.com/limetech/webgui/pull/1196.patch');
break;
case '6.12.0-beta5':
$gitRoot = '/usr/local/emhttp/';
applyPatch('https://github.com/limetech/webgui/pull/1226.patch');
// fix issues from patch 1226, can only be applied if 1227 has not been applied
if (!file_exists('/tmp/bleeding_edge_toolkit/https___github.com_limetech_webgui_pull_1227.patch')) {
downloadOrDelete('https://raw.githubusercontent.com/limetech/webgui/468b679280a8c004e4130b30d8aa97fcaef037d9/', 'plugins/dynamix/WG0.page');
downloadOrDelete('https://raw.githubusercontent.com/limetech/webgui/468b679280a8c004e4130b30d8aa97fcaef037d9/', 'plugins/dynamix/WGX.page');
downloadOrDelete('https://raw.githubusercontent.com/limetech/webgui/468b679280a8c004e4130b30d8aa97fcaef037d9/', 'plugins/dynamix/include/update.wireguard.php');
}
applyPatch('https://github.com/limetech/webgui/pull/1227.patch');
applyPatch('https://github.com/limetech/webgui/pull/1228.patch');
applyPatch('https://github.com/limetech/webgui/pull/1229.patch');
applyPatch('https://github.com/limetech/webgui/pull/1231.patch');
applyPatch('https://github.com/limetech/webgui/pull/1232.patch');
applyPatch('https://github.com/limetech/webgui/pull/1233.patch');
applyPatch('https://github.com/limetech/webgui/pull/1234.patch');
applyPatch('https://github.com/limetech/webgui/pull/1235.patch');
applyPatch('https://github.com/limetech/webgui/commit/3f08b99c9849165a70b65cb6213cc40cbef024ac.patch');
applyPatch('https://github.com/limetech/webgui/pull/1236.patch');
applyPatch('https://github.com/limetech/webgui/pull/1237.patch');
applyPatch('https://github.com/limetech/webgui/pull/1238.patch');
applyPatch('https://github.com/limetech/webgui/commit/cd687b329467d553b7ea3db7ad63585a3e0f216f.patch');
applyPatch('https://github.com/limetech/webgui/pull/1243.patch');
logger('about to enable PHP error logging');
file_put_contents('/etc/php.d/errors-php.ini', "error_log='/var/log/phplog'\ndisplay_startup_errors='0'\ndisplay_errors='0'\nlog_errors='1'\nerror_reporting='32767'\n");
logger('about to update smartctl_type');
$smartctl_file = '/usr/local/sbin/smartctl_type';
$smartctl_contents = file_get_contents($smartctl_file);
$smartctl_contents = str_replace('$type = $disk[\'smType\'];', '$type = $disk[\'smType\']??\'\';', $smartctl_contents);
file_put_contents($smartctl_file, $smartctl_contents);
// install pre-release version of gui.search plugin
$pkg = 'gui.search-2023.01.28b-x86_64-1.txz';
if (is_dir('/usr/local/emhttp/plugins/gui.search/') && !is_file('/tmp/' . $pkg)) {
logger('about to update gui.search plugin');
@unlink('/usr/local/emhttp/plugins/gui.search/gui.search.page');
@unlink('/tmp/gui.search/searchResults.json');
if (file_put_contents('/tmp/' . $pkg, file_get_contents('https://github.com/Squidly271/gui.search/raw/main/archive/' . $pkg))) {
$output = null;
$retval = null;
exec('installpkg /tmp/' . $pkg, $output, $retval);
logger("Returned with status $retval and output:");
logger(print_r($output, true));
}
}
logger('faking /etc/unraid-version as 6.12.0-beta6 so plugins will respond to the new code');
file_put_contents('/etc/unraid-version', 'version="6.12.0-beta6"' . "\n");
break;
case '6.12.0-beta7':
$gitRoot = '/usr/local/emhttp/';
// ignore errors
applyPatch('https://github.com/limetech/webgui/pull/1244.patch');
// fix git merge issues
$file = '/usr/local/emhttp/plugins/dynamix/nchan/device_list';
if (file_exists($file) && !file_exists($file . ".sav")) {
logger('about to update ' . $file);
copy($file, $file . ".sav");
$contents = file_get_contents($file);
$contents = str_replace('$size = my_scale($disk[\'size\'] ? $disk[\'size\']*1024 : $disk[\'sectors\']*$disk[\'sector_size\'],$unit,-1);', '$size = my_scale(isset($disk[\'size\']) ? $disk[\'size\']*1024 : $disk[\'sectors\']*$disk[\'sector_size\'],$unit,-1);', $contents);
file_put_contents($file, $contents);
} else {
logger('skipping ' . $file);
}
$file = '/usr/local/emhttp/plugins/dynamix.system.temp/include/SystemTemp.php';
if (file_exists($file) && !file_exists($file . ".sav")) {
logger('about to update ' . $file);
copy($file, $file . ".sav");
$contents = file_get_contents($file);
$contents = str_replace('$docroot = $docroot ?: $_SERVER[\'DOCUMENT_ROOT\'] ?: \'/usr/local/emhttp\';', '$docroot = \'/usr/local/emhttp\';', $contents);
file_put_contents($file, $contents);
} else {
logger('skipping ' . $file);
}
applyPatch('https://github.com/limetech/webgui/pull/1246.patch');
applyPatch('https://github.com/limetech/webgui/pull/1247.patch');
applyPatch('https://github.com/limetech/webgui/pull/1248.patch');
applyPatch('https://github.com/limetech/webgui/pull/1249.patch');
applyPatch('https://github.com/limetech/webgui/pull/1250.patch');
applyPatch('https://github.com/limetech/webgui/pull/1251.patch');
applyPatch('https://github.com/limetech/webgui/pull/1252.patch');
break;
case '6.12.0-beta8':
$gitRoot = '/usr/local/emhttp/';
applyPatch('https://github.com/limetech/webgui/pull/1253.patch');
applyPatch('https://github.com/limetech/webgui/pull/1254.patch');
break;
case '6.12.0-beta10':
$gitRoot = '/usr/local/emhttp/';
applyPatch('https://github.com/limetech/webgui/pull/1255.patch');
break;
case '6.12.0-beta12':
$gitRoot = '/usr/local/emhttp/';
applyPatch('https://github.com/limetech/webgui/pull/1258.patch');
applyPatch('https://github.com/limetech/webgui/pull/1259.patch');
break;
case '6.12.0-beta13':
$gitRoot = '/usr/local/emhttp/';
applyPatch('https://github.com/limetech/webgui/pull/1260.patch');
applyPatch('https://github.com/limetech/webgui/pull/1261.patch');
applyPatch('https://github.com/limetech/webgui/pull/1262.patch');
applyPatch('https://github.com/limetech/webgui/pull/1263.patch');
break;
case '6.12.0-beta14':
case '6.12.0-beta15':
$gitRoot = '/usr/local/emhttp/';
applyPatch('https://github.com/limetech/webgui/pull/1265.patch');
applyPatch('https://github.com/limetech/webgui/pull/1266.patch');
break;
case '6.12.0-beta17':
$gitRoot = '/usr/local/emhttp/';
applyPatch('https://github.com/limetech/webgui/pull/1271.patch');
applyPatch('https://github.com/limetech/webgui/pull/1272.patch');
break;
case '6.12.0-beta19':
$gitRoot = '/usr/local/emhttp/';
applyPatch('https://github.com/limetech/webgui/pull/1279.patch');
break;
// no break between these
case '6.12.0-rc1':
$gitRoot = '/usr/local/emhttp/';
applyPatch('https://github.com/limetech/webgui/pull/1282.patch');
applyPatch('https://github.com/limetech/webgui/pull/1283.patch');
case '6.12.0-rc1a':
$gitRoot = '/usr/local/emhttp/';
applyPatch('https://github.com/limetech/webgui/pull/1284.patch');
applyPatch('https://github.com/limetech/webgui/pull/1285.patch');
case '6.12.0-rc1b':
$gitRoot = '/usr/local/emhttp/';
applyPatch('https://github.com/limetech/webgui/pull/1286.patch');
break;
case '6.12.0-rc2':
$gitRoot = '/usr/local/emhttp/';
applyPatch('https://github.com/limetech/webgui/pull/1290.patch');
break;
case '6.12.0-rc2.4':
$gitRoot = '/usr/local/emhttp/';
applyPatch('https://github.com/limetech/webgui/pull/1297.patch');
break;
case '6.12.0-rc2.9':
$gitRoot = '/usr/local/emhttp/';
applyPatch('https://github.com/limetech/webgui/pull/1300.patch');
applyPatch('https://github.com/limetech/webgui/pull/1301.patch');
break;
case '6.12.0-rc3':
$gitRoot = '/usr/local/emhttp/';
applyPatch('https://github.com/limetech/webgui/pull/1304.patch');
applyPatch('https://github.com/limetech/webgui/pull/1305.patch');
applyPatch('https://github.com/limetech/webgui/pull/1306.patch');
break;
case '6.12.0-rc3.2':
$gitRoot = '/usr/local/emhttp/';
applyPatch('https://github.com/limetech/webgui/pull/1308.patch');
applyPatch('https://github.com/limetech/webgui/pull/1309.patch');
break;
case '6.12.0-rc4.2':
$gitRoot = '/usr/local/emhttp/';
applyPatch('https://github.com/limetech/webgui/pull/1318.patch');
break;
case '6.12.0-rc5':
$gitRoot = '/usr/local/emhttp/';
applyPatch('https://github.com/limetech/webgui/pull/1322.patch');
$execCmd = "curl -s \"https://gist.githubusercontent.com/ljm42/8998275a99bf42c1cf335c8126ab1c15/raw/install.sh?\${RANDOM}\" | bash 2>&1";
exec($execCmd, $output, $retval);
logger("Returned with status $retval and output:");
logger(print_r($output, true));
break;
case '6.12.0-rc5.1':
$gitRoot = '/usr/local/emhttp/';
applyPatch('https://github.com/limetech/webgui/pull/1324.patch');
$execCmd = "curl -s \"https://gist.githubusercontent.com/ljm42/8998275a99bf42c1cf335c8126ab1c15/raw/install.sh?\${RANDOM}\" | bash 2>&1";
exec($execCmd, $output, $retval);
logger("Returned with status $retval and output:");
logger(print_r($output, true));
break;
case '6.12.0-rc5.3':
$gitRoot = '/usr/local/emhttp/';
applyPatch('https://github.com/limetech/webgui/pull/1326.patch');
applyPatch('https://github.com/limetech/webgui/pull/1327.patch');
# fix git merge issues
downloadOrDelete('https://raw.githubusercontent.com/bergware/webgui/73b536c7ae97769895ec0fc4b9da88cae7d98235/', 'plugins/dynamix/scripts/netconfig');
applyPatch('https://github.com/limetech/webgui/pull/1328.patch');
applyPatch('https://github.com/limetech/webgui/pull/1329.patch');
break;
case '6.12.0-rc6.3':
$gitRoot = '/usr/local/emhttp/';
applyPatch('https://github.com/limetech/webgui/pull/1339.patch');
break;
case '6.12.0-rc6.12':
// starting with this release, gitRoot is assumed to be '/usr/local/'
applyPatch('https://github.com/limetech/webgui/pull/1347.patch');
makeSymlink("/usr/local/etc/rc.d/rc.library.source", "/etc/rc.d/rc.library.source");
applyPatch('https://github.com/limetech/webgui/pull/1349.patch');
applyPatch('https://github.com/limetech/webgui/pull/1350.patch');
applyPatch('https://github.com/limetech/webgui/pull/1351.patch');
//applyPatch('https://github.com/limetech/webgui/pull/1331.patch');
break;
// no break between these
case '6.12.0':
case '6.12.1-beta1':
applyPatch('https://github.com/limetech/webgui/pull/1358.patch');
applyPatch('https://github.com/limetech/webgui/pull/1359.patch');
case '6.12.1-beta2':
applyPatch('https://github.com/limetech/webgui/pull/1360.patch');
break;
case '6.12.2-beta2':
applyPatch('https://github.com/limetech/webgui/pull/1365.patch');
applyPatch('https://github.com/limetech/webgui/pull/1366.patch');
break;
case '6.12.3-rc2':
applyPatch('https://github.com/limetech/webgui/pull/1375.patch');
applyPatch('https://github.com/limetech/webgui/pull/1376.patch');
break;
case '6.12.4-rc4':
applyPatch('https://github.com/limetech/webgui/pull/1390.patch');
break;
case '6.12.4-rc5':
applyPatch('https://github.com/limetech/webgui/pull/1391.patch');
applyPatch('https://github.com/limetech/webgui/pull/1392.patch');
applyPatch('https://github.com/limetech/webgui/pull/1393.patch');
applyPatch('https://github.com/limetech/webgui/pull/1394.patch');
applyPatch('https://github.com/limetech/webgui/pull/1395.patch');
applyPatch('https://github.com/limetech/webgui/pull/1397.patch');
applyPatch('https://github.com/limetech/webgui/pull/1398.patch');
break;
case '6.12.4-rc7':
applyPatch('https://github.com/limetech/webgui/pull/1399.patch');
break;
case '6.12.4-rc18.1':
applyPatch('https://github.com/limetech/webgui/pull/1419.patch');
break;
case '6.12.4':
case '6.13.0-beta0.9':
applyPatch('https://github.com/limetech/webgui/pull/1424.patch');
break;
default:
logger('nothing to do for Unraid version ' . $unraid['version']);
break;
}
// add System Drivers PR
/*
if (str_starts_with($unraid['version'], "6.12.2") ||
str_starts_with($unraid['version'], "6.12.3") ||
( str_starts_with($unraid['version'], "6.12.4-rc") && (substr($unraid['version'], -1) < 4) ) ||
( str_starts_with($unraid['version'], "6.13.0-beta0.") && (substr($unraid['version'], -1) < 9) )
) {
applyPatch('https://github.com/limetech/webgui/pull/1366.patch');
applyPatch('https://github.com/limetech/webgui/pull/1388.patch');
}
*/
$guisearch_dir = "/tmp/gui.search";
if (is_dir($guisearch_dir)) {
logger("--- deleting gui search results so it will be regenerated");
shell_exec("rm -rf $guisearch_dir");
}
// close log file
fclose($logHandle);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment