]> ###2018.03.09 - Update for unRAID v6.5 RC - Strict PHP regarding non-quoted constant - Thank you Squid ###2018.01.25 - Update for unRAID v6.4 - Thank you Squid ###2017.03.03 - Added TRAY_NUM to HISTORICAL data - If drives fails you can see in which tray it was last seen - Added debug option - Time Profiling for data gathering performance analysis and future optimizations - Fixed support for ARECA controllers ###2015.09.25 - Added support for ARECA controllers ###2015.09.22 - Fixed USB location in "Layout" tab when trays are configured as Vertical and the array is "narrow" - Removed all duration other than hours in Power-On-Hours - Added support for SCSI (SAS) drives ###2015.06.15 - Fixed indexing of tooltip table CSS - Added triangle/arrow to the Tooltip frame - Added USB devices on "Layout" tab ###2015.06.12 - Added device status icon (same as unRAID icons) - Added option to delete historical devices (per device) from database under "Historical Device" table ###2015.06.11 - Remove EMPTY row and columns pull-down options in Layout Settings - HW scan speed optimization - Changed USB path from "lsusb" to "lsscsi -t" - HW scan speed optimization - Changed USB data gathering from "lsusb -D" to "udevadm" so I can scan only USB storage devices ###2015.06.08-2 - Fixed bug - introduced by new parameter array "TRAY_SHOW" ###2015.06.08-1 - Fixed bug - introduced by new parameter array "GENERAL" ###2015.06.08 - Added support for HIDDEN TRAYS - click on preview tray to show/hide it - don't forget to save settings - Increased number of maximum trays to 99 (from 26) - Supports better usage of HIDDEN TRAYS - Removed "User Utilities" icon - part of unRAID v6 RC4 - Add Enable/Disable for Tooltips - Fixed "UNRAID" functionality recognition for USB devices ###2015.06.01 - Added transform (rotation and translate) support for other browsers (-webkit, -ms) - Added Tooltip Disk information for each tray on "Layout" tab and settings for each field in "Settings" tab - Compacted data and settings tables rows - Added "User Utilities" icon ###2015.05.31 - Moved plugin to "Settings" --> "User Utilities" on unrAID WEBUI - Added "Set All" and "Clear All" buttons for each field view setting columns in "Settings" tab ###2015.05.30 - Removed PATH change clears TRAY_NUM assignment - Enabled editing of FIRST_INSTALL_DATE - Added POWER_ON_HOURS for HDDs - Added START_STOP_COUNT for HDDs - Added NOTES field ###2015.05.28-3 - Changed "packageVER" to be same as "version" - Changed "launch" to be dependent on "name" of plugin - Added button on "Data" tab for updating Smartmontools database - Added "Report" tab - Fix: New disk scraped data was not being saved ###2015.05.28-2 - Changed EOL from Windows to Unix - Add launch option for the Plugin Manager - Removed icon references from .page files - Removed "---" from main .page file (remove empty tab) ###2015.05.28-1 - Replaced "-sata" with "-ata" when searching drives ###2015.05.28 - Initial Release logit() { echo "" echo "$1" } DOWNLOAD_PKG="false" INSTALL_PKG="false" logit "Installing plugin..." if [ ! -d "&pluginLOC;" ] ; then logit "Creating plugin folder &pluginLOC;" mkdir -p "&pluginLOC;" else logit "Plugin folder &pluginLOC; already exists" fi logit "Checking existing package &pluginLOC;/&packagefile;..." if [ -f "&pluginLOC;/&packagefile;" ] ; then PKG_LOCAL_MD5=$(/usr/bin/md5sum &pluginLOC;/&packagefile; | cut -d' ' -f1) if [ "$PKG_LOCAL_MD5" == "&packageMD5;" ] ; then logit "Latest package already exists &pluginLOC;/&packagefile;" INSTALL_PKG="true" else logit "Local/Online package MD5 mismatch ($PKG_LOCAL_MD5/&packageMD5;) on &pluginLOC;/&packagefile; - deleting local package" DOWNLOAD_PKG="true" fi else logit "Latest package does not exist &pluginLOC;/&packagefile;" DOWNLOAD_PKG="true" fi if [ "$DOWNLOAD_PKG" == "true" ]; then logit "Saving any previous packages from &pluginLOC;" mkdir -p "/tmp/&name;-packages" TEMP="&pluginLOC;/&name;-package-*" mv -f $TEMP "/tmp/&name;-packages" logit "Attempting to download plugin package &packageURL;..." wget --quiet --spider --no-check-certificate --timeout=10 &packageURL; if [ ! $? == "0" ] ; then logit "Package server down &packageURL; - Plugin cannot install" INSTALL_PKG="false" else wget --quiet --no-check-certificate --timeout=10 -O &pluginLOC;/&packagefile; &packageURL; if [ ! -f "&pluginLOC;/&packagefile;" ] ; then logit "Package download failed &packageURL; - Plugin cannot install" INSTALL_PKG="false" else PKG_LOCAL_MD5=$(/usr/bin/md5sum &pluginLOC;/&packagefile; | cut -d' ' -f1) if [ "$PKG_LOCAL_MD5" != "&packageMD5;" ] ; then logit "Package MD5 mismatch ($PKG_LOCAL_MD5/&packageMD5;) on &pluginLOC;/&packagefile; - Plugin cannot install" INSTALL_PKG="false" else logit "Package &packagefile; downloaded to &pluginLOC; - MD5 match "$PKG_LOCAL_MD5"" INSTALL_PKG="true" fi fi fi fi if [ "$INSTALL_PKG" == "true" ] ; then logit "Extracting plugin package..." [ -d "&emhttpLOC;" ] && rm -fR "&emhttpLOC;" tar -xf "&pluginLOC;/&packagefile;" -C "/" echo "Version=\"&version;\"" >> "&emhttpLOC;/&name;.page" rm -Rf "/tmp/&name;-packages" rm -f "/tmp/&name;-install" logit "Plugin and Package file &packagefile; extracted and installed successfully" exit 0 else if [ -f "&pluginLOC;/&packagefile;" ] ; then rm -f "&pluginLOC;/&packagefile;" fi logit "Reverting back to previously saved packages..." TEMP1="/tmp/&name;-packages" TEMP2=$(ls $TEMP1) if [ "$TEMP2" != "" ] ; then TEMP="/tmp/&name;-packages/&name;-package-*" mv -f $TEMP "&pluginLOC;" logit "Previous packages restored" else logit "No previous packages to restored" fi rm -Rf "/tmp/&name;-packages" rm -f "/tmp/&name;-install" logit "Plugin install failed" exit 1 fi logit() { echo "$1" echo "" } logit "Removing plugin..." [ -f "/tmp/&name;-install" ] && rm -f "/tmp/&name;-install" [ -d "&emhttpLOC;" ] && rm -fR "&emhttpLOC;" logit "Plugin stopped and removed - no files removed from &pluginLOC;"