Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[?] Parameterize the <FILE> part of the plugin

Featured Replies

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>

 

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 :)

  • 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?

 

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.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.