September 1, 201510 yr Is there any include required for update.htm like there is with update.php? Include is optional with update.php and does not exist for update.htm.
September 1, 201510 yr From the syslog: run_cmd: invalid cmd: /plugins/Btsync/scripts/rc.Btsync&arg1=install The command looks right to me however.
September 1, 201510 yr interestingly, if I remove the &arg=install part, the command no longer fails... but doesn't run the install part.
September 1, 201510 yr fixed it with the following: <form name="app_install" method="POST" action="/update.htm" target="progressFrame"> <input type="hidden" name="cmd" value="/plugins/<?=$appname;?>/scripts/rc.<?=$appname;?>"/> <input type="hidden" name="arg1" value="install"/> <input <?=$app_disabled;?> type="submit" id="STDSMBUTTON" value="Install"/> </form> apparently, the arguments must come as a separate input value and can't be appended onto the command value. Crappy, because this method may completely break unraid 5 functionality.
September 1, 201510 yr Author Crappy, because this method may completely break unraid 5 functionality. Unfortunate is the word you're looking for.
September 1, 201510 yr Can you tell me where in the OS i can get the unraid version that is installed?
September 1, 201510 yr Author Can you tell me where in the OS i can get the unraid version that is installed? If you look at the unRAIDServer.plg file you will see that it can be obtained by looking at /etc/unraid-version.
September 1, 201510 yr I seemed to perhaps run into another small problem. On Unraid 6.1 I am not able to pass more than 9 arguments from PHP to the RC file. The arguments are named arg1, arg2...arg9,arg10... I think when it hits arg10 it is being picked up as arg1 again. It's possible that there is something I'm not aware of preventing the rest of the values from being passed. Do you have any suggestions, or have you come across this before?
September 1, 201510 yr Author I seemed to perhaps run into another small problem. On Unraid 6.1 I am not able to pass more than 9 arguments from PHP to the RC file. The arguments are named arg1, arg2...arg9,arg10... I think when it hits arg10 it is being picked up as arg1 again. It's possible that there is something I'm not aware of preventing the rest of the values from being passed. Do you have any suggestions, or have you come across this before? Nothing in webGui uses more than 1 or 2 args and I set the limit to 10. "10 args aught to be enough for anyone" - apparently not, this will require a new release.
September 1, 201510 yr Author The plugin largest plugin I have (plexconnect) uses 26. Honest Q: why run somthing like plexconnect as a plugin? Why not a docker container? There may come a day when unRaid does not support these kinds of plugins at all.
September 1, 201510 yr I seemed to perhaps run into another small problem. On Unraid 6.1 I am not able to pass more than 9 arguments from PHP to the RC file. The arguments are named arg1, arg2...arg9,arg10... I think when it hits arg10 it is being picked up as arg1 again. It's possible that there is something I'm not aware of preventing the rest of the values from being passed. Do you have any suggestions, or have you come across this before? You might be able to reduce those args by either using update.php and #file to save config settings or converting some of the bash script to use php instead. All I use now is a start and stop script.
September 1, 201510 yr I've encoded them down to one argument sent from the PHP file and in the RC file is decodes the argument back into all the pieces. It was easier than a full re-write of 20 plugins.
September 1, 201510 yr I've encoded them down to one argument sent from the PHP file and in the RC file is decodes the argument back into all the pieces. Maybe it is good to know that Dynamix has built-in support for reading and saving settings. For reading the settings, you can use the function "parse_plugin_cfg" at the beginning of the page, like this: $cfg = parse_plugin_cfg("plexconnect"); This will store all settings in the array $cfg. Next you need to include the #file parameter in the form field, for example <form markdown="1" method="POST" action="/update.php" target="progressFrame"> <input type="hidden" name="#file" value="plexconnect/plexconnect.cfg"> Parameter Depth description: : <input type="text" name="depth" value="<?=$cfg['depth']?>"/> ... more parameter fields ... : <input type="submit" name="#apply" value="Apply"><input type="button" value="Done" onclick="done()"> </form>
September 8, 201510 yr just to clarify - a few questions: * Can I run shell_exec() on system utilities without using a wrapper script ? * Can I run commands in /usr/local/sbin using shell_exec() without a wrapper script ? * What would be the best practice to keep plugin compatibility for unRAID 6.0 and prior?
September 9, 201510 yr just to clarify - a few questions: * Can I run shell_exec() on system utilities without using a wrapper script ? * Can I run commands in /usr/local/sbin using shell_exec() without a wrapper script ? * What would be the best practice to keep plugin compatibility for unRAID 6.0 and prior? You can run shell_exec() within the page. The wrapper scripts are for POST/GET situations.
September 9, 201510 yr just to clarify - a few questions: * Can I run shell_exec() on system utilities without using a wrapper script ? * Can I run commands in /usr/local/sbin using shell_exec() without a wrapper script ? * What would be the best practice to keep plugin compatibility for unRAID 6.0 and prior? You can run shell_exec() within the page. The wrapper scripts are for POST/GET situations. So in exec() and exec_shell() I can run any command from any folder? not limited to the plugin folder?
September 9, 201510 yr just to clarify - a few questions: * Can I run shell_exec() on system utilities without using a wrapper script ? * Can I run commands in /usr/local/sbin using shell_exec() without a wrapper script ? * What would be the best practice to keep plugin compatibility for unRAID 6.0 and prior? You can run shell_exec() within the page. The wrapper scripts are for POST/GET situations. So in exec() and exec_shell() I can run any command from any folder? not limited to the plugin folder? Yeah commands through php like this will still work. Just POST commands like from a form have to be wrapped. $apache_version = shell_exec( "/usr/sbin/httpd -v | grep version | sed -e 's/^Server version: Apache\///'" );
Archived
This topic is now archived and is closed to further replies.