January 19, 201313 yr Hello, Can I parameterize the <FILE> part of an unRAID plugin? for example: <FILE Name=$PARAMETER_LOCAL_FILE Run="upgradepkg --install-new"> <URL>$PARAMETER_URL</URL> </FILE>
January 19, 201313 yr installplg is a simple PHP script so you can open it it with your favorite editor to see how the "FILE" tag is processed. At this time, it doesn't seem to directly support any kind substitution. However, depending on your situation, you could work around that limitation with an INLINE file that mimics the FILE/URL of installplg... <FILE Name="/tmp/some_temporary_file_name" Run="/bin/bash"> <INLINE> <![CDATA[ # Source or Whatever You Need To Fill Your $full_path_and_filename and $url source /boot/config/plugins/SomePlugin/SomePlugin.cfg # Manually Download Your File Only If It Doesnt Already Exists To Prevent Downloading Every Reboot! [ ! -f $full_path_and_filename ] && wget -nv -O $full_path_and_filename $url # Manually Install It upgradepkg --install-new $full_path_and_filename # Clean Up rm -f /tmp/some_temporary_file_name ]]> </INLINE> </FILE> Note that I am not an official plugin writer so there may be a more elegant solution out there
January 19, 201313 yr Author installplg is a simple PHP script so you can open it it with your favorite editor to see how the "FILE" tag is processed. At this time, it doesn't seem to directly support any kind substitution. However, depending on your situation, you could work around that limitation with an INLINE file that mimics the FILE/URL of installplg... <FILE Name="/tmp/some_temporary_file_name" Run="/bin/bash"> <INLINE> <![CDATA[ # Source or Whatever You Need To Fill Your $full_path_and_filename and $url source /boot/config/plugins/SomePlugin/SomePlugin.cfg # Manually Download Your File Only If It Doesnt Already Exists To Prevent Downloading Every Reboot! [ ! -f $full_path_and_filename ] && wget -nv -O $full_path_and_filename $url # Manually Install It upgradepkg --install-new $full_path_and_filename # Clean Up rm -f /tmp/some_temporary_file_name ]]> </INLINE> </FILE> Note that I am not an official plugin writer so there may be a more elegant solution out there Will I have to invoke this "some_temporary_file_name" file or will it run automatically when running the plg file?
January 19, 201313 yr Will I have to invoke this "some_temporary_file_name" file or will it run automatically when running the plg file? Asking that question would have me suggest you to look more closely at existing scripts to understand the fundamentals of the PLG file and its various options. Short answer: Because Run="" is specified, installplg will automatically execute that command on the file specified in the Name="" if it has been created successfully. In the original example, it would execute execute: /bin/bash /tmp/some_temporary_file_name
Archived
This topic is now archived and is closed to further replies.