From b2cf6fec8ddb13fcf576ee548c808897a5d4db66 Mon Sep 17 00:00:00 2001 From: Squidly271 Date: Fri, 2 Feb 2018 20:58:41 -0500 Subject: [PATCH 1/2] Add ability for pluginMan to not install the .plg Currently, to use the plugin manager as an easy method of running one-off scripts that DO NOT need to be re-run at boot time, the script needs to exit with a non-zero return code to force pluginMan to not copy the .plg to /boot/config/plugins. The trigger for this is a new attribute of "noInstall" When its value is non-null, the .plg will not get saved to /bot/config/plugins, but the .plg can still exit with a proper zero return code. Admittedly, not too much call for this, but it would have come in handy for my Support / Project template update script for 6.4.1-rc2 --- plugins/dynamix.plugin.manager/scripts/plugin | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/plugins/dynamix.plugin.manager/scripts/plugin b/plugins/dynamix.plugin.manager/scripts/plugin index 432145f14..71060dfaf 100755 --- a/plugins/dynamix.plugin.manager/scripts/plugin +++ b/plugins/dynamix.plugin.manager/scripts/plugin @@ -495,9 +495,13 @@ if ($method == "install") { // Bergware change: add user or system plugin selection - deprecated $plugintype = plugin("plugintype", $plugin_file, $error); $target = $plugintype != "system" ? "/boot/config/plugins/$plugin" : "/boot/plugins/$plugin"; - if ($target != $plugin_file) copy($plugin_file, $target); - symlink($target, "/var/log/plugins/$plugin"); - echo "plugin: installed\n"; + if ( ! plugin("noInstall",$plugin_file,$error) ) { + if ($target != $plugin_file) copy($plugin_file, $target); + symlink($target, "/var/log/plugins/$plugin"); + echo "plugin: installed\n"; + } else { + echo "Script: executed\n"; + } exit(0); } From 9d8806e8b159a38d61238e2b5c40f3b147d70dda Mon Sep 17 00:00:00 2001 From: Squidly271 Date: Fri, 2 Feb 2018 21:00:48 -0500 Subject: [PATCH 2/2] fix spacing on code --- plugins/dynamix.plugin.manager/scripts/plugin | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/plugins/dynamix.plugin.manager/scripts/plugin b/plugins/dynamix.plugin.manager/scripts/plugin index 71060dfaf..64977abd5 100755 --- a/plugins/dynamix.plugin.manager/scripts/plugin +++ b/plugins/dynamix.plugin.manager/scripts/plugin @@ -495,13 +495,13 @@ if ($method == "install") { // Bergware change: add user or system plugin selection - deprecated $plugintype = plugin("plugintype", $plugin_file, $error); $target = $plugintype != "system" ? "/boot/config/plugins/$plugin" : "/boot/plugins/$plugin"; - if ( ! plugin("noInstall",$plugin_file,$error) ) { - if ($target != $plugin_file) copy($plugin_file, $target); - symlink($target, "/var/log/plugins/$plugin"); - echo "plugin: installed\n"; - } else { - echo "Script: executed\n"; - } + if ( ! plugin("noInstall",$plugin_file,$error) ) { + if ($target != $plugin_file) copy($plugin_file, $target); + symlink($target, "/var/log/plugins/$plugin"); + echo "plugin: installed\n"; + } else { + echo "Script: executed\n"; + } exit(0); }