]> &displayName; Change Log ======================== ####By: PhAzE 2016.09.16.1 ------------ - Renamed Resilio, this will remove old btsync references and install the new Resilio plugin 2016.07.11.1 ------------ - Updated latestversion function to grab the version from their version.txt hosted on getsync website for better accuracy on version number 2016.06.14.1 ------------ - Changed wget commands to curl since the app's website disabled SSLv3 and wget on Unraid was not compatible 2015.11.04.1 ------------ - Fixed jQuery to check if loaded before loading itself in, this fixes stuck loader icon on settings page 2015.09.26.1 ------------ - Fixed webui link, uses DNS name instead of IP as IP wouldn't resolve 2015.09.01.1 ------------ - V3 initial release - Added environment shortcut, Appname-env, so users can access the environment easier from anywhere - Added display for array state and app version number - Added WebUI button instead of having to click on the word 'running' - Added loading screen to display what the app is doing when the plugin page is loading (not working on unRAID 5) - Added new icons for warnings - Added app config sync back to plg config so settings are transfered on app stop - Added plugin logger function, writes to log file in /tmp dir for each plugin - Added activity log button so users can see hostory of plugin controls being used - Added support for HTTPS in any application that allows it and fixed apps that had broken HTTPS - Added ellipsis for version numbers so long hashes don't mess up the UI layout - Updated certs to 2015 version instead of using old 2013 version - Updated plugin to follow array state, disables function if array is offline - Updated all of the PHP code for a newer unified look - Updated for dark theme on unRAID 6 - Updated PHP styles so they are all moved to CSS sheets instead of being all over the place - Updated CSS to standardized and organized layout - Updated all variables to use LOCAL where possible to reduce any variable leakage and reduce RAM usage - Updated plg.old creation and moved it into the .plg file - Changed dependencies independent location codebase so they can be installed in other locations - Changed dependencies so if cache drive is found, they are installed there - Changed dependencies so if no cache drive is found, they are installed in RAM drive like normal - Changed warnings so they are less intrusive and take up less space - Changed RC code so all chown commands and mkdir commands reside in one funtion - Changed 30% of the RC code, has been rewritten for better control of the application - Fixed text that is displayed when starting and stopping app, minimal shown, logged in activity log in detail - Fixed capitalization across all plugins to match on the UI - Moved dependency install out of .plg file into RC file, prior to write export function - Verified all return, break, and exit codes to be used in proper spots to prevent code breakage 2015.07.28.1 ------------ - Fixed glitch in updater that was messing up the entire OS on random occasions 2015.07.01.1 ------------ - Updated for unRAID 6 final to comply with changes in OS 2015.05.03.1 ------------ - Fixed remove script so it no longer shows an error on Unraid 5 - Added change log to plugins page on Unraid GUI 2015.01.03.1 ------------ - Fixed backwards compatibility with v1 plugins INITIAL RELEASE --------------- - Re-writen from scratch to run with Unraid 6 Plugin Manager - Universal based plugin now downloads appropriate depedencies based on the OS architeture used - Installs from USB copy if no internet connection is found and files exist on USB - Added GUI setting to disable online checks by the plugin on page load - Added dependency section to view main dependency versions and very they are working - Added ability to uninstall the plugin and files from within the plugin GUI - Dependencies now install to a common folder and app starts with a wrapper script - Wrapper script adds environment variables for the common dependency folder upon start - When plugin is uninstalled from PLGMGR or plugin GUI all files even dependencies are removed - Plugin uninstall leaves installdir and configdir, up to user to delete those if they are not needed # ============================================== # The 'remove' script # ============================================== app_logger() { # First passed item is the text ($1), secone item is severity ($2 - info, warn, error), third is where to log ($3 - all, log) local PLGLOGFILE="/var/log/PhAzE-Logs/&name;.log" local LOGTEXT=$1 local LOGTYPE=$2 local LOGVAR=$3 local TIMESTAMP=`date +"%Y-%m-%d %T"` # Set the type of log if [ "$LOGTYPE" == "info" ]; then TYPE="[INFO]" elif [ "$LOGTYPE" == "warn" ]; then TYPE="[WARNING]" elif [ "$LOGTYPE" == "error" ]; then TYPE="[ERROR]" fi # If log file doesn't exist, make it if [ ! -f "$PLGLOGFILE" ]; then mkdir -p "/var/log/PhAzE-Logs" touch "$PLGLOGFILE" fi # Echo the text to display and log, or just log file if [ "$LOGVAR" == "all" ]; then echo -e "${LOGTEXT}" echo -e "${TIMESTAMP} ${TYPE}\t${LOGTEXT}" >> "$PLGLOGFILE" elif [ "$LOGVAR" == "log" ]; then echo -e "${TIMESTAMP} ${TYPE}\t${LOGTEXT}" >> "$PLGLOGFILE" fi } # Get the arch type to see what version of unraid is running ARCHTYPE=$( /usr/bin/uname -m ) # Stop the app if the control file exists [ -f "/usr/local/emhttp/plugins/&name;/scripts/rc.&name;" ] && /usr/local/emhttp/plugins/&name;/scripts/rc.&name; stop app_logger "Uninstalling &displayName; plugin..." info all sleep 1 # Check for cache drive and make sure its an actual disk drive PHAZECOMMON="/usr/local/PhAzE-Common" COMMONCHECK="" [ -f "/usr/local/emhttp/plugins/&name;/scripts/rc.&name;" ] && COMMONCHECK=`/usr/local/emhttp/plugins/&name;/scripts/rc.&name; checkcache` [ "$COMMONCHECK" == "true" ] && PHAZECOMMON="/mnt/cache/.PhAzE-Common" # Remove all files and directories pertaining to this plugin [ -d "${PHAZECOMMON}/&name;" ] && rm -fR "${PHAZECOMMON}/&name;" [ "$(find ${PHAZECOMMON} -type f | grep startcfg.sh | wc -l 2> /dev/null)" == "0" ] && rm -Rf "${PHAZECOMMON}" TESTPLG=`grep -H -m1 "ENTITY author" /boot/config/plugins/*.plg 2> /dev/null | grep "PhAzE" | cut -d: -f1 | grep -v "&name;.plg" | wc -l 2> /dev/null` if [ "$TESTPLG" == "0" ]; then [ -f "/usr/local/emhttp/plugins/webGui/PhAzE.page" ] && rm -f "/usr/local/emhttp/plugins/webGui/PhAzE.page" [ -f "/usr/local/emhttp/plugins/webGui/icons/Phaze.png" ] && rm -f "/usr/local/emhttp/plugins/webGui/icons/Phaze.png" fi [ -d "/usr/local/emhttp/plugins/&name;" ] && rm -fR "/usr/local/emhttp/plugins/&name;" [ -e "/etc/rc.d/rc.&name;" ] && rm -f "/etc/rc.d/rc.&name;" [ -L "/etc/rc.d/rc.&name;" ] && rm -f "/etc/rc.d/rc.&name;" [ -f "/usr/bin/&name;-env" ] && rm -f "/usr/bin/&name;-env" [ -f "/var/log/plugins/&name;.plg" ] && rm -f "/var/log/plugins/&name;.plg" if [ -f "/boot/config/plugins/&name;/&name;.cfg" ] && [ ! -d "/boot/config/plugins/Resilio" ]; then mkdir /boot/config/plugins/Resilio fi if [ -f "/boot/config/plugins/&name;/&name;.cfg" ] && [ ! -f "/boot/config/plugins/Resilio/Resilio.cfg" ]; then cp "/boot/config/plugins/&name;/&name;.cfg" "/boot/config/plugins/Resilio/Resilio.cfg" fi [ -d "/boot/config/plugins/&name;" ] && rm -fR "/boot/config/plugins/&name;" [ -f "/boot/config/plugins/&name;.plg.old" ] && rm -f "/boot/config/plugins/&name;.plg.old" if [ "x86_64" != "$ARCHTYPE" ]; then [ -f "/boot/config/plugins/&name;.plg" ] && rm -f "/boot/config/plugins/&name;.plg" fi app_logger "************************** " info log app_logger "Uninstall complete - Reboot to remove remaining dependency files " info all app_logger "************************** " info log sleep 1 # ========================================================================= # Download required plugin files # ========================================================================= app_logger "App name has changed, downloading new plugin file... " info all # Check for net connectivity to the repo, 5 second timeout then fails NETCHECK=`timeout 5 wget --no-check-certificate -qST4 --spider "https://github.com/PhAzE-Variance" 2>&1 | grep HTTP | tail -1 | cut -f1 | awk '{print $NF}'` if [ "$NETCHECK" == "OK" ]; then HASNET="yes" else HASNET="no" fi # Downloads the new plugin file since the name has changed from its current state mkdir -p /tmp wget --no-check-certificate -qO "/tmp/Resilio.plg" "https://github.com/PhAzE-Variance/unRAID/raw/master/Plugins/Resilio.plg" app_logger "...New plugin file downloaded! " info all # ============================================== # The 'install' script # ============================================== app_logger "Installing new plugin file... " info all if [ -f "/tmp/Resilio.plg" ]; then /bin/bash -c "/usr/local/sbin/installplg /tmp/Resilio.plg" sleep 1 ARCHTYPE=$( /usr/bin/uname -m ) if [ "x86_64" != "$ARCHTYPE" ]; then [ ! -f "/boot/config/plugins/Resilio.plg" ] && mv -f "/tmp/Resilio.plg" "/boot/config/plugins/Resilio.plg" fi fi [ -f "/tmp/&name;-script" ] && rm -f "/tmp/&name;-script"