Files
unraid-versionchange/unraid-versionchange.plg

271 lines
9.6 KiB
XML

<?xml version='1.0' standalone='yes'?>
<!DOCTYPE PLUGIN [
<!ENTITY name "unraid-versionchange">
<!ENTITY author "ich777">
<!ENTITY version "2025.04.25">
<!ENTITY launch "Settings/versionchange">
<!ENTITY gitURL "https://git.minenet.at/&author;/&name;/raw/branch/master">
<!ENTITY pluginURL "&gitURL;/&name;.plg">
<!ENTITY md5 "62c749fcc1ce586d1afac64327f96404">
<!ENTITY plugin "/boot/config/plugins/&name;">
<!ENTITY emhttp "/usr/local/emhttp/plugins/&name;">
]>
<PLUGIN name="&name;" author="&author;" version="&version;" launch="&launch;" pluginURL="&pluginURL;" min="6.8.2" icon="wrench">
<CHANGES>
###2025.04.25
- Minor bugfix for icon in header menu not hiding when opening search
- Make sure the releases are refreshed when visiting the plugin page if more than five minutes have passed since the last visit - only applies if INITIAL_UPDATE is set to 1 in settings.cfg
###2024.12.09
- Add Unraid Patch to version change routine
###2023.12.14
- Minor visual improvements to version change routine
###2023.12.01
- Made plugin compatible with new behaviour of test branch
###2023.11.16a
- Fix for QUICK_LINK button not showing by moving it in front of Logout button
###2023.11.16
- Move QUICK_LINK to menu bar instead of version number for unRAID version 6.13.0-beta0.23+
- Fix for QUICK_LINK always being enabled
- Enable QUICK_LINK by default
###2023.11.03
- Also include memtest when changing versions
- Only check sha256 files on bz* files
- Add note if exit status 2 is encountered while unzip
###2023.07.26
- Bugfix for button Release Notes not showing with LIST_STYLE set to 0 and CACHE_BUILDS enabled
- Set max dropdown width for drop down from LIST_STYLE 1 to 500px
- Remove all empty lines if found in settings.cfg
- Changed default for LIST_STYLE to 1
- Changed default for INITIAL_UPDATE to 1
###2023.07.15
- Add variable AUTH to settings.cfg
###2023.07.13
- Detect if Plugin-Update-Helper is installed and display message to check notifications on version change
###2023.06.15
- Bugfix for version sorting if LIST_STYLE=1 is used
###2023.05.09
- Bugfix changed sort order at removal routine from cached builds when reaching the maximum from last change to last access
###2023.05.08
- Bugfix for PHP warning about undefined array
###2023.05.02
- Added CACHE_MOUNT to settings.cfg. Set this variable to the source from your Unassigned Devices share (eg: //192.168.0.1/versionchange) and the plugin tries to mount the share through Unassigned Devices, otherwise set to: false
- Bugfix for uncaught reference error when visiting the plugin page
###2023.04.28
- Bugfix for warning messages which are not complete visible on certain themes
###2023.04.26a
- Added warning text for upgrading and downgrading - thanks ljm42
- Fixed a issue in the Markdown parser to not show font as italic between two underscores to not mess up Kernel options in the Release Notes
###2023.04.26
- Function openChanges (with Markdown formatting) is now default for versions 6.11.0-rc4 and up for Release Notes, if older version is found openBox is used
- Don't reload site when Release Notes are closed only applies version below 6.11.0-rc4
###2023.04.23
- Added Release Notes button for cached builds (depends on CACHE_BUILDS enabled)
###2023.03.31
- Bugfix for QUICK_LINK and GLOBAL_CONFIG enabled if CACHE_PATH is not yet mounted - thanks ljm42
###2023.03.30
- Detect if release is already cached and change Download &amp; Install button to Install - thanks ljm42
- Bugfix don't include non release files in cached_builds file
- Bugfix for INITIAL_UPDATE function
- Minor visual changes
###2023.03.29b
- Added indicator what version will be installed on next reboot - thanks ljm42
- Bugfix for json building if custom CACHE_PATH and GLOBAL_CONFIG is set to 1
###2023.03.29a
- Moved temporary release directory to CACHE_PATH if GLOBAL_CONFIG is set to 1
###2023.03.29
- Added GLOBAL_CONFIG to settings.cfg Available options: 0 = disabled | 1 = enalbed (depends on custom CACHE_PATH), please note that you manually have to copy over a settings.cfg to your CACHE_PATH from the plugin.
###2023.03.24a
- Changed cursor style from input cursor to pointer at Version string below Unraid logo when QUICK_LINK is set to 1
###2023.03.24
- Version string below Unraid logo now clickable to get quickly to the plugin page. Depends on QUICK_LINK set to 1 - thanks ljm42
###2023.03.23a
- Fixed Update Releases button not showing when LIST_STYLE is set to 1
###2023.03.23
- Fixed bug where no index for cached builds was created if INITIAL_UPDATE was set to 1 and INDEX_URL is not reachable
- Added LIST_STYLE to settings.cfg Available options: 0 = two drop downs (release channel and release) | 1 = one drop down (all releases sorted by version and release channel next to the release name)
###2023.03.22
- Fix, don't reset release channel if one was choosen
- Added arrow indicators to drop down if versions are upgrades, downgrades or the current version
- Added checkmark indicator to drop down if release is locally available - depends on CACHE_BUILDS enabled
- Added Servername and running unRAID version on the plugin page
- Display message on plugin page if custom cached builds path is not found or mounted
- Added Download button to download builds only - depends on CACHE_BUILDS enabled
###2023.03.21a
- Added check if bz* files in /boot/previous are mounted, if yes skip backup - thanks ljm42
###2023.03.21
- Made directory for cached builds changeable - depends on CACHE_BUILDS enabled
###2023.03.16
- Changed error message on extraction error, only display exit status instead of a specific message
- Changed how archive is extracted to save even more RAM when using this plugin on machines with less than 8GB of RAM
###2023.03.15
- Display message if disk space is exceeded or display exit status if another error occurred while extracting archive
###2023.03.14
- Added option INITIAL_UPDATE to settings.cfg to update the releases on the first visit from the plugin page. Available options: 0 = disabled | 1 = enabled - online update | 2 = only generate index from already cached builds - offline update (this option depends CACHE_BUILDS option enabled)
###2023.03.05a
- Added fallback if download server is not reachable and CACHE_BUILDS is enabled to generate index on the locally available builds
###2023.03.05
- Added option CACHE_BUILDS to settings.cfg to cache the last n of downloaded builds on the USB Flash Device, if set to 0 no builds will be cached
###2023.02.21a
- Added check for sha256 files and error fail-safe
- Added sync after version change
- Sort versions to display the latest first
- Made unzip quiet
- Removed sleep from initial message
###2023.02.21
- Added Reboot Now banner message - thank you Larry
###2023.02.20a
- Fixed typo
###2023.02.20
- Fix for plugin-update-helper not detecting new version
###2023.02.17
- split INDEX_URL from BASE_URL
###2023.02.16a
- Added pop up for Update Releases
- Added checks for Update Releases and Update Unraid Version
- Corrected a few typos
###2023.02.16
- Initial release
</CHANGES>
<FILE Run="/bin/bash">
<INLINE>
rm -f $(ls /boot/config/plugins/&name;/unraid.versionchange*.txz 2>/dev/null|grep -v '&version;')
</INLINE>
</FILE>
<FILE Name="/boot/config/plugins/&name;/unraid.versionchange-&version;.txz" Run="upgradepkg --install-new">
<URL>&gitURL;/packages/unraid.versionchange-&version;.txz</URL>
<MD5>&md5;</MD5>
</FILE>
<FILE Name="&emhttp;/README.md">
<INLINE>
**Unraid Version Change**
This plugin allows you to quickly download and install Unraid versions through the plugin page (a reboot is still required).
</INLINE>
</FILE>
<FILE Run="/bin/bash">
<INLINE>
#Create settings file if not found
if [ ! -f "&plugin;/settings.cfg" ]; then
echo 'BASE_URL=https://fastdl.minenet.at/Unraid
INDEX_URL=https://fastdl.minenet.at/Unraid
CACHE_BUILDS=0
CACHE_PATH=default
CACHE_MOUNT=false
INITIAL_UPDATE=1
LIST_STYLE=1
QUICK_LINK=1
GLOBAL_CONFIG=0
AUTH=' > "&plugin;/settings.cfg"
fi
#Add missing settings.cfg entries
if ! grep -q "INDEX_URL=" &plugin;/settings.cfg; then
sed -i '$ a\INDEX_URL=https://fastdl.minenet.at/Unraid' &plugin;/settings.cfg
fi
if ! grep -q "CACHE_BUILDS=" &plugin;/settings.cfg; then
sed -i '$ a\CACHE_BUILDS=0' &plugin;/settings.cfg
fi
if ! grep -q "INITIAL_UPDATE=" &plugin;/settings.cfg; then
sed -i '$ a\INITIAL_UPDATE=1' &plugin;/settings.cfg
fi
if ! grep -q "CACHE_PATH=" &plugin;/settings.cfg; then
sed -i '$ a\CACHE_PATH=default' &plugin;/settings.cfg
fi
if ! grep -q "LIST_STYLE=" &plugin;/settings.cfg; then
sed -i '$ a\LIST_STYLE=1' &plugin;/settings.cfg
fi
if ! grep -q "QUICK_LINK=" &plugin;/settings.cfg; then
sed -i '$ a\QUICK_LINK=1' &plugin;/settings.cfg
fi
if ! grep -q "GLOBAL_CONFIG=" &plugin;/settings.cfg; then
sed -i '$ a\GLOBAL_CONFIG=0' &plugin;/settings.cfg
fi
if ! grep -q "CACHE_MOUNT=" &plugin;/settings.cfg; then
sed -i '$ a\CACHE_MOUNT=false' &plugin;/settings.cfg
fi
if ! grep -q "AUTH=" &plugin;/settings.cfg; then
sed -i '$ a\AUTH=' &plugin;/settings.cfg
fi
#Remove all empty lines in settings.cfg
sed -i '/^[[:space:]]*$/d' &plugin;/settings.cfg
</INLINE>
</FILE>
<FILE Run="/bin/bash" Method="remove">
<INLINE>
echo "----------------------------------------------"
echo "---Uninstalling Unraid VersionChange plugin---"
echo "----------------------------------------------"
# Remove plugin related files
removepkg unraid.versionchange-&version;
rm -rf /usr/local/emhttp/plugins/&name; &plugin; /tmp/unraid-versionchange
echo
echo "-----------------------------------------------------"
echo "------Unraid VersionChange plugin uninstalled!-------"
echo "-----------------------------------------------------"
echo
</INLINE>
</FILE>
</PLUGIN>