]> ## Network UPS Tools (NUT) for UNRAID ###2024.09.16 - new: the preview (latest build) backend was updated to the most recent master branch as of 16.09.2024 - new: moved "NUT Command Center" to seperate page (shown when NUT is running) for better logical separation - new: do not show "powertop" warning in GUI as that is included in any user-generated debug packages anyway - fix: reworked certain bash scripts to better standards with more safety for strange configurational states ###2024.09.13 - important fix: address possible flock condition causing installation script to stall (thanks AgentXXL) ###2024.09.12a - fix: made optical changes regarding wording, positioning and helptexts on the NUT Settings page - fix: refactored some minor code parts in the backend bash scripts to better standards and less verbosity - new: use of plugin usage metric functions to aid plugin (UPS driver) development and planning (toggleable) - new: the preview (latest build) backend was updated to the most recent master branch as of 12.09.2024 ###2024.09.07 - new: added "NUT Command Center" in GUI to execute software-based commands on supported UPS devices - fix: removed some legacy CSS stylesheets and re-factored minor outdated code passages to better standards ###2024.09.06 - new: the preview (latest build) backend was updated to the most recent master branch as of 06.09.2024 - new: custom scripting to execute commands when a UPS status is encountered (see GUI configuration editor) - fix: reduced loading time of NUT Settings page by outsourcing functions from PHP to JavaScript where possible - fix: refactored UPS status handling routines to be more efficient and resilient when encountering null values ###2024.08.14 - new: the preview (latest build) backend was updated to the most recent master branch as of 14.08.2024 - fix: the preview backend now includes the final fix for the APC BX series issues (merged NUT GitHub PR #2565) ###2024.08.07 - new: the preview (latest build) backend was updated to the most recent master branch as of 07.08.2024 - fix: the preview backend additionally includes a prospective fix for the APC BX series issues (NUT GitHub PR #2565) - release note: please report back on the Unraid forums if the preview backend resolves any APC BX series issues (or not) ###2024.07.27 - new: added GUI settings to configure SNMP version and MIB - new: scanning mechanisms and auto configure now also detect SNMP devices - fix: refactored some legacy code in the backend bash scripts to better standards ###2024.06.23 - fix: renamed generic function names to avoid declaration collisions with other plugins ###2024.05.05 - new: the preview (latest build) backend was updated to the most recent master branch as of 05.05.2024 - new: minified the GUI dependencies to reduce the package size and also the page load times within the GUI - fix: minor fixes across shell scripts regarding process selecting and handling of generated debug packages ###2024.04.03 - fix: important changes to plugin removal routine to also remove any active rule-based syslog filters - fix: made optical changes regarding wording, positioning and helptext of the rule-based syslog filters - new: added a possibility to view the NUT spam-log from the GUI when rule-based syslog filters are active ###2024.04.02 - new: default backend updated from previous NUT 2.8.1 stable release to new NUT 2.8.2 stable release - new: added a new "previous" backend for users wishing to remain on the previous NUT 2.8.1 stable release - new: added a setting to filter specific repetitive UPS connection events from the SYSLOG to reduce spamming - fix: overhauled logging of NUT start, stop and restart for better diagnosis of occuring errors through SYSLOG - fix: added a warning symbol for any NUT passwords using special characters as this caused issues for some users - fix: dropped some legacy code and hardened GUI code some more against Cross-Site Scripting (XSS) vulnerabilities - fix: streamlined configuration file layouts for better readability and following of layouts advised in NUT manuals - fix: added txt file extension to most files in NUT debug package for better readability on the go (on mobile devices) ###2024.03.28 - new: shortened UPS statuses removing some previous lengthy explanations for better dashboard displaying - new: present the dynamic output power factor in the dashboards instead of the static nominal power factor - new: when NUT debug package is requested for download by user, also include standard anonymized diagnostics - new: in case of important messages from the plugin maintainers, such will now be displayed in the NUT settings - fix: minor modifications to debug package now also blacking out any serial numbers in UPS configuration file ###2024.03.26 - fix: relax strict legacy UPS name standards to also allow hyphens in the UPS name (not recommended) - fix: cleaned up legacy code surrounding the NUT configuration editor and updated related dependencies - fix: minor code revisions and quality of life improvements surrounding configurations and some legacy code ###2024.03.16 - fix: safeguards against unwarranted shutdowns w/ null responses from upsc (thanks: danielb7390) ###2024.03.10 - fix: no longer overwrite configuration files with static, non-changing information over and over - fix: improved transparency in configuration files as to which lines are reserved and overwritten - fix: improved safeguards against failing file operations when shifting around configuration files ###2024.03.04 - release note: it is advised to update to this version before updating your system to UNRAID 6.13+ - new: important changes in NUT configuration layouts and backends for future UNRAID versions 6.13+ - new: add the UPS status and battery charge to non-collapsed miniature dashboard for better overview - fix: changed to more descriptive and consistent notification messages regarding all UPS power events - fix: changed severity level of some UPS states to be more visible in GUI, particularly a UPS on battery - fix: major overhaul and fixes of NUT notification service for reliable power event information and logs - fix: UPS overload now colors the actual power consumed to red color instead of the nominal power of UPS ###2024.03.01 - fix: bugfixes across the GUI and preparations for future UNRAID versions 6.13+ ###2024.02.28 - new: implement USB diagnostics and override for USB device power management - new: implement checks for common power management related problems in debug package ###2024.02.27 - new: implement NUT device scanner into GUI for easier selection of UPS drivers - new: include more information about system detected USB devices in debug package - fix: reduce any unnecessary upsmon process forking to consume less system resources - fix: minor cosmetic changes in GUI regarding the positioning of the NUT command buttons - fix: detect presence of "powertop" package and warn user about related complications in GUI ###2024.02.23 - new: detect if APCUPSD is also running alongside NUT and warn user about related complications in GUI - new: the preview (latest build) backend was updated to the most recent master branch as of 23.02.2024 - fix: minor quality of life improvement regarding the handling of legacy code causing warning messages - fix: minor cosmetic GUI changes related to the positioning of warning messages for the user to notice ###2023.12.11 - fix: allow setting the UPS Name in manual configuration mode so that GUI dashboards are populated - new: the preview (latest build) backend was updated to most recent master branch as of 11.12.2023 ###2023.11.24 - new: added a warning to the "Auto Config" tool explaining its scope and intended function - new: added a shutdown mode "None (the UPS decides)" which waits for LB event before shutdown - new: the preview (latest build) backend was updated to most recent master branch as of 24.11.2023 ###2023.11.08 - fix: important backend and backend switch preparations for future UNRAID versions 6.13+ - new: preview (latest build) backend updated to most recent master branch as of 08.11.2023 ###2023.11.06 - new: minor optimizations, re-factorings and overall quality of life improvements ###2023.11.01 - new: default backend pinned to NUT 2.8.1 stable release, no more frequent backend changes from here - new: users who want all bleeding-edge changes can select "preview (latest build)" as backend instead - new: the previous update warning is no longer in effect for the default backend (as it is pinned now) - new: unsuccessful start of NUT services is now shown as an error message in the GUI pointing to logs - new: NUT environment variables are now in effect to reduce spamming of some diagnostic/debug messages ###2023.10.28 - fix: cleaned up all code files in preparation of the NUT 2.8.1 stable backend currently in the works - fix: reworked the GUI visibility toggles so that all mode-unrelated settings are now hidden from GUI - fix: prevent the SNMP driver from holding up the rest of the boot process under some rare circumstances ###2023.10.24 - new: default backend updated to master branch as of 24.10.2023 (w/bugfix: no-comm shutdown as slave) ###2023.10.22 - new: default backend updated to master branch as of 22.10.2023 (w/bugfix for APC periodic shutdown) - new: updated libmodbus package to support new MODBUS driver for APC devices (Serial, USB or TCP) - new: improved NUT scanner feature to improve auto detection and configuration of UPS devices - new: introduced a configuration mode where users can use a custom ups.conf file and GUI settings - fix: off-loaded new NUT dashboard from unrelated GUI pages to reduce load and page loading times - fix: no longer show the NUT runtime statistics module settings on systems without support for it ###2023.10.19 - new: introduced GUI setting for UPS reporting minutes instead of seconds for battery runtime left - fix: major bugfixes and re-factoring of outdated code (particularly for front-page NUT dashboards) - fix: dashboard no longer expands randomly when collapsed, now respects user visibility settings - fix: dashboard no longer shows on front page and takes up space when NUT itself is not running - fix: refactored the automatic refreshing functions and clarified the scope of their settings in GUI - fix: minor bugfixes across the NUT settings and the UPS time calculation/measurement functions ###2023.10.12a - new: option to raise the debug level on UPS driver and NUT monitor for diagnostic purposes - new: option to export an extensive (anonymized) NUT debug package for diagnostic purposes - new: added some additional USB-based UPS drivers to GUI dropdown for improved accessibility - new: also install the libmodbus libraries on 6.10+ as they are required by some UPS drivers - fix: minor cosmetic changes in GUI and GUI documentation texts - fix: increase maximum allowed field length for UPS port to more reasonable value ###2023.10.06 - new: default backend updated to most recent master branch as of 06.10.2023 (upstream bugfixes) - new: default 6.13+ backend updated to most recent master branch as of 06.10.2023 (upstream bugfixes) ###2023.09.26 - new: stats module: hide stats module pages when deactivated (thanks to ich777) - new: compute UPS load from power variables when not reported by UPS (where possible) ###2023.09.23 - new: default backend updated to most recent master branch as of 23.09.2023 (upstream bugfixes) ###2023.09.17a/b - fix: stats module: updated override helptext with correct way to disable an unneeded chart (disable, not disabled) - fix: stats module: minor bugfixes for better handling of user misconfigurations ###2023.09.17 - new: default backend updated to most recent master branch as of 17.09.2023 (upstream bugfixes) - new: stats module: off-loaded the charts to a seperate page for performance and preventing configuration dead-lock - new: stats module: users can now set their own variables and descriptions for charts via variable override - new: stats module: users can now disable individual unneeded charts via variable override - new: stats module: users can now set the polling/updating frequency (how often the charts update) - fix: reworked all bash scripts to better standards with more safety for strange configurational states ###2023.09.15 - new: runtime statistics module introduces fancy charts for UPS variables in GUI (on 6.12.3+) - fix: configuration mismatch in rare cases when resetting configuration via GUI - fix: security fixes and runtime statistic charts now respecting theme settings (thanks to Peuuuur Noel) ###2023.09.14 - new: major refactor of GUI setting ordering, descriptions and help-texts - new: default backend updated to most recent master branch as of 14.09.2023 ###2023.09.11 - new: allow user to choose older NUT backend in case of UPS problems (on 6.10+) ###2023.09.10 - fix: refactored old code for PHP8 to minimize PHP warnings - fix: minor bugfixes across the GUI/frontend ###2023.09.07 - fix: do not approximate current VA when it is reported correctly by UPS ###2023.09.02 - new: act on user configured notification triggers - fix: improve logging for GUI actions ###2023.08.29 - new: user configuration now persists between reinstalls of the plugin - new: added a button to GUI to reset all configuration files to their defaults - new: defined safe zones for additional settings in the configuration files - fix: clarified reload button in GUI some more for understanding what it does - fix: minor changes in how copy operations of configuration files are handled - fix: run UPS inverter poweroff also as root to avoid driver permission issues - fix: nut scanner is now no longer breaking user configuration files ###2023.08.28 - new: refactored handling of permissions and wording of log messages - new: refactored and decluttered installation, upgrading and removal processes - new: improved upgrading process making sure all existing NUT services are stopped first - new: compiled backend NUT package from current GitHub master branch (as of 26.08.2023) - new: optimized backend NUT package to use folder structure of earlier releases - new: added official Slackware Net-SNMP package with OpenSSL 3.1.2 for future UNRAID versions 6.13+ - new: added backend NUT package compiled with OpenSSL 3.1.2 for future UNRAID versions 6.13+ ###2023.08.24 - new: compiled backend NUT package from current master branch (as of 24.08.2023) ###2023.07.26 - fix: reduce console spam of copy operations by redirecting output to /dev/null, as requested in 2023.07.21 #3 (comment) - fix: stop services before a plugin upgrade on the live system to remove any file locks preventing files from getting patched on the running instance. a reboot should now no longer be required for all changes> - fix: old installation remnants cause updating or transitioning to another nut package on running instance to fail - fix: fix a permissions issue causing some drivers in 2.8.0 not to have access to their required folders - new: add button for users to be able to save their UPS details into a dummy-ups compliant diagnostics file this file can then be uploaded on the forums and given to the developers in case problems with the plugin arise thanks to @Peuuuur-Noel for the improvements to the privacy of the exported files (removing serial, macaddr) - Looks like the Tooltipster js lib was broken due to duplicate "copyright" id in footer code. - fix Removed #copyright from footer and applied CSS directly to the element. Thanks to forum member Peuuuur Noel and Rysz for the PRs. ###2023.07.24a - fix override realpower if realpower nominal set manually - simplification of realpower/apparent power if value set manually - used U+2009 to separate number and unit (W/VA) - remove obsolete lowbatt fail-safe Thanks to forum member Peuuuur Noel and Rysz for the PRs. ###2023.07.23a - fix: updated code for better calculation and display (in settings/footer/dashboard) between apparent power, real/true power and data available from NUT - add: display power factor in settings page - add: use ups.realpower if available Thanks to forum member Peuuuur Noel for the PR. ###2023.07.22 - fix: persist config files when rebooting - add: implement lowbatt event fail-safe in settings - add: always pull-in latest config files on reinstall/upgrade - add: implement battery replacement notification in settings Thanks to forum member Rysz for the PR. ###2023.06.03 - Add Small footer style thanks ich777 for the PR. ###2023.02.14 -6.12 Dashboard support -PHP8 fixes -Refresh option. ###2022.03.20 -fix for filetree top level -update nut footer ###2021.01.08 - fix plugin package permissions - cybrnook -update help text to reflect minutes ###2020.05.16 - gfjardim - Show dashboard even if footer is disabled ###2020.05.11 - update nut package for 6.8 ###2020.03.17 - gfjardim - added footer and dashboard plus many other tweaks ###2019.02.03 - update all icons to fa icons - fix editor font in black theme ###2019.01.24 - update settings icon to fa font ###2018.11.25 - add autov to css and js - build nut package from usblib-1.0 branch - remove support link from readme ###2018.05.09 - fix Autodetect - fix null port error ###2018.04.29 - fix rc script interfering with cupsd - fix Run time in red only when on battery thanks @realies - compile nut-2.7.4.20180429 libusb 1.0+0.1 branch for 6.5 added patch for wait and retry ###2018.01.16 - tweak notification event and subject ###2018.01.14 - fix nut power showing 0 ###2018.01.09 - update nut package to 2.7.4 2017.11.29 commit fd7189d - revert Eaton use-case since it is included in nut package - add ups va and watt capacity inputs for ups that do not present real power nominal ###2018.01.06 - add Eaton use-case to improve load accuracy thanks @realies ###2018.01.03 - fix load for ups with ups.power.nominal vs ups.realpower.nominal ###2017.11.29 - fix permissions so nut conf are not world readable - fix nut-scanner options, only scan usb for auto config ###2017.11.26 - fix plugin install service starting when disabled ###2017.11.25 - fix snmp port input box length and add ip mask ###2017.11.03 - update killpower flag - update permissions and security for nut configs - change username and password variables - add slave user and password ###2017.10.28 - downgrade nut package to 2.7.4 due to usb resets in 6.4rc10b ###2017.10.10 - fix ipaddr filter - update input masks for ipaddr, name and username ###2017.10.08a - fix move old pids to new location - compile nut package to latest commit 2017.09.21 - fix: new nut package uses /etc/nut and /var/run/nut ###2017.10.05 - fix add username and password to upsd users - add autorefresh to editor to fix line number placement - move cdnjs to local - update support for new themes ###2017.09.17 - add ability to change UPS Monitor Name, User and Password - update icons ###2017.06.17a - add support for 6.4 themes ###2017.06.04 - add net-snmp package ###2017.05.27 - add autodetection for UPS - fix ip mask ###2017.05.26 - add master/slave options - fix runtime display format ###2017.05.24 - add dropdown options for battery and timers - add killpower flag condition to shutdown script ###2017.05.22 - fix shutdown scripts - move default nut conf files ###2017.05.20 - fix manual config settings ###2017.05.19 - fix reload button - add start conditions to rc script ###2017.05.17 - add manual mode, reload and config editor to settings page - reformat settings page, hide unused vars - add vars, rewrite, combine and move scripts - add snmp settings from Ambrotos fork - untested - add UPS summary, UPS details page and dashboard page - add dynamix plugin api - remove depreciated code - restructure and repackage plugin - rename nut plugin package to difer from nut package ###2015.09.19### - UPS statistics now auto updates(every two seconds) ###2015.08.24### - added launch from plugins(saarg) ###2015.08.23### - added blazer_ser to drivers ###2015.08.23### - Public Release - Fix, Restart on upgrades ###2015.08.22### - Uninstall fixes - Fix autorestart after upgrade - Make USB drivers selectable - Add shutdown on battery levels - Remove user/password and hardcode them (see plugin help) - Moved scripts to plugin folder for 6.1 (ln -s rc.nut) ###2015.08.21### - Initial Release - Test Version (plg) echo "Checking for other installed NUT versions..." if [ -f /boot/config/plugins/nut.plg ] || [ -f /boot/config/plugins/nut-2.8.0.plg ]; then echo "" echo "-----------------------------------------------------------" echo "ERROR: YOU ALREADY HAVE ANOTHER VERSION OF NUT INSTALLED." echo "Please make note of your configuration and uninstall any existing NUT packages." echo "-----------------------------------------------------------" echo "" exit 1 fi echo "Making sure all existing NUT services are stopped (before install/upgrade)..." if [ -x /etc/rc.d/rc.nut ]; then if ! /etc/rc.d/rc.nut stop >/dev/null 2>&1; then echo "WARNING:" echo "WARNING: The NUT installation script was not able to stop all NUT services gracefully." echo "WARNING: IN CASE OF PROBLEMS, please REBOOT YOUR SYSTEM to complete any upgrades." echo "WARNING:" fi killall nut-poller >/dev/null 2>&1 fi if [ -x /etc/rc.d/rc.nutstats ]; then if ! /etc/rc.d/rc.nutstats disable >/dev/null 2>&1; then echo "WARNING:" echo "WARNING: The NUT installation script was not able to stop all NUT statistic services gracefully." echo "WARNING: IN CASE OF PROBLEMS, please REBOOT YOUR SYSTEM to complete any upgrades." echo "WARNING:" fi fi if [ ! -f /boot/config/plugins/nut-dw/migration-failed ] && [ -d /boot/config/plugins/nut-old ]; then rm -rf /boot/config/plugins/nut-old fi if [ -d /boot/config/plugins/nut ] && [ ! -d /boot/config/plugins/nut-dw ]; then MIGRATIONFAILED="NO" echo "Now migrating previous NUT configuration layout to new NUT configuration layout..." mkdir -p /boot/config/plugins/nut-dw 2>&1 || MIGRATIONFAILED="YES" cp -rf /boot/config/plugins/nut/* /boot/config/plugins/nut-dw/ 2>&1 || MIGRATIONFAILED="YES" mv -f /boot/config/plugins/nut-dw/nut.cfg /boot/config/plugins/nut-dw/nut-dw.cfg 2>&1 || MIGRATIONFAILED="YES" [ -d /boot/config/plugins/nut-dw ] 2>&1 || MIGRATIONFAILED="YES" [ -f /boot/config/plugins/nut-dw/nut-dw.cfg ] 2>&1 || MIGRATIONFAILED="YES" if [ "$MIGRATIONFAILED" == "YES" ]; then echo "WARNING:" echo "WARNING: The NUT installation script was not able to migrate your NUT configuration to the new layout." echo "WARNING: For NUT to remain functional it will be necessary to start with a fresh configuration instead." echo "WARNING:" echo "WARNING: The previous NUT configuration remains untouched at this location: /boot/config/plugins/nut-old" echo "WARNING: You can use old configuration for reference, but try to set up NUT with the fresh configuration." echo "WARNING:" echo "WARNING: === Steps for Manual Migration of Configuration Layout (For Advanced Users / Not Recommended) ===" echo "WARNING: 1. Uninstall NUT" echo "WARNING: 2. Rename Folder [/boot/config/plugins/nut-old] to [/boot/config/plugins/nut-dw]" echo "WARNING: 3. Rename File [/boot/config/plugins/nut-dw/nut.cfg] to [/boot/config/plugins/nut-dw/nut-dw.cfg]" echo "WARNING: 4. Reinstall NUT" echo "WARNING:" echo "Now reverting to fresh NUT configuration..." rm -rf /boot/config/plugins/nut-dw mkdir -p /boot/config/plugins/nut-dw find /var/log/packages/ -type f -iname "nut*" -exec removepkg {} \; rm -rf /usr/local/emhttp/plugins/nut rm -rf /usr/local/emhttp/plugins/nut-dw rm -rf /etc/nut rm -rf /etc/ups rm -rf /var/run/nut rm -rf /var/state/ups rm -rf /etc/nutstats if [ -f /boot/config/plugins/dynamix/nutstats.cron ]; then rm -f /boot/config/plugins/dynamix/nutstats.cron sleep 1 update_cron sleep 1 fi touch /boot/config/plugins/nut-dw/migration-failed 2>&1 else echo "Your NUT configuration layout has been successfully migrated to the new NUT configuration layout." touch /boot/config/plugins/nut-dw/migration-complete 2>&1 fi rm -f /boot/config/plugins/nut/*.md5 rm -f /boot/config/plugins/nut/*.txz mv -f /boot/config/plugins/nut /boot/config/plugins/nut-old fi echo "" exit 0 &pkgURL;/nut-2.8.2-x86_64-6master.ssl31.txz 22bc34383a493bf3834e5c64d69fedb2 &pkgURL;/nut-2.8.2-x86_64-1stable.ssl31.txz 35b740e9e92b6d42cde6600724e57417 &pkgURL;/nut-2.8.1-x86_64-3stable.ssl31.txz ed16442a55705053d3413ff756c64ea7 &pkgURL;/nut-2.8.0-x86_64-3stable.ssl31.txz 766d0e0fa3a2ecf42e439b012d8b6614 &pkgURL;/nut-2.7.4.20200318-x86_64-1.txz 52de2867d6b8f6bc1a98a45870b05420 CONFIG=&plgPATH;/&name;.cfg if [ -e "$CONFIG" ]; then source "$CONFIG" if [ "$BACKEND" == "preview" ]; then echo "Installing user-configured PREVIEW backend for NUT..." upgradepkg --install-new &plgPATH;/nut-2.8.2-x86_64-6master.ssl31.txz elif [ "$BACKEND" == "default" ]; then echo "Installing DEFAULT backend for NUT..." upgradepkg --install-new &plgPATH;/nut-2.8.2-x86_64-1stable.ssl31.txz elif [ "$BACKEND" == "previous" ]; then echo "Installing user-configured PREVIOUS backend for NUT..." upgradepkg --install-new &plgPATH;/nut-2.8.1-x86_64-3stable.ssl31.txz elif [ "$BACKEND" == "stable" ]; then echo "Installing user-configured STABLE backend for NUT..." upgradepkg --install-new &plgPATH;/nut-2.8.0-x86_64-3stable.ssl31.txz elif [ "$BACKEND" == "legacy" ]; then echo "Installing user-configured LEGACY backend for NUT..." upgradepkg --install-new &plgPATH;/nut-2.7.4.20200318-x86_64-1.txz else echo "Installing DEFAULT backend for NUT..." upgradepkg --install-new &plgPATH;/nut-2.8.2-x86_64-1stable.ssl31.txz fi else echo "Installing DEFAULT backend for NUT..." upgradepkg --install-new &plgPATH;/nut-2.8.2-x86_64-1stable.ssl31.txz fi echo "" &pkgURL;/nut-2.8.2-x86_64-6master.ssl11.txz f4555efc5b4951893bfb84abe77d8f70 &pkgURL;/nut-2.8.2-x86_64-1stable.ssl11.txz 83e33e9efa44c8a652b07acf5a76a3c4 &pkgURL;/nut-2.8.1-x86_64-2stable.ssl11.txz c27e063a311ffee9426aae6dcce8ee48 &pkgURL;/nut-2.8.0-x86_64-2stable.ssl11.txz 80364beffcab0d4dbe80ae0ad91416eb &pkgURL;/nut-2.7.4.20200318-x86_64-1.txz 52de2867d6b8f6bc1a98a45870b05420 CONFIG=&plgPATH;/&name;.cfg if [ -e "$CONFIG" ]; then source "$CONFIG" if [ "$BACKEND" == "preview" ]; then echo "Installing user-configured PREVIEW backend for NUT..." upgradepkg --install-new &plgPATH;/nut-2.8.2-x86_64-6master.ssl11.txz elif [ "$BACKEND" == "default" ]; then echo "Installing DEFAULT backend for NUT..." upgradepkg --install-new &plgPATH;/nut-2.8.2-x86_64-1stable.ssl11.txz elif [ "$BACKEND" == "previous" ]; then echo "Installing user-configured PREVIOUS backend for NUT..." upgradepkg --install-new &plgPATH;/nut-2.8.1-x86_64-2stable.ssl11.txz elif [ "$BACKEND" == "stable" ]; then echo "Installing user-configured STABLE backend for NUT..." upgradepkg --install-new &plgPATH;/nut-2.8.0-x86_64-2stable.ssl11.txz elif [ "$BACKEND" == "legacy" ]; then echo "Installing user-configured LEGACY backend for NUT..." upgradepkg --install-new &plgPATH;/nut-2.7.4.20200318-x86_64-1.txz else echo "Installing DEFAULT backend for NUT..." upgradepkg --install-new &plgPATH;/nut-2.8.2-x86_64-1stable.ssl11.txz fi else echo "Installing DEFAULT backend for NUT..." upgradepkg --install-new &plgPATH;/nut-2.8.2-x86_64-1stable.ssl11.txz fi echo "" &pkgURL;/nut-2.7.4.20200318-x86_64-1.txz 52de2867d6b8f6bc1a98a45870b05420 &pkgURL;/nut-2.7.4.20181125-x86_64-1.txz a46d656085991e02a605786007412d76 &pkgURL;/nut-2.7.4.20171129-x86_64-1.txz 24702ef930855db3432ed9ee73e93d42 &pkgURL;/net-snmp-5.9.4-x86_64-1.txz df3f30cdb8680f79ca8f2d1ecf77a156 &pkgURL;/net-snmp-5.9.3-x86_64-1.txz 5beebc819894c94bedbc531d47cfe497 &pkgURL;/net-snmp-5.7.3-x86_64-4.txz b9ef68216b97cb5f0bcd9f3312e5941e &pkgURL;/libmodbus-3.1.10-x86_64-2usb.txz 63c06646d01daaa8389e885ac2f8778e &pkgURL;/libmodbus-3.1.10-x86_64-1usb.txz b833d6ceffad69a19ac871b74be95eb3 &gitURL;/archive/&plgNAME;.txz &plgMD5; CONFIG=&plgPATH;/&name;.cfg if [ -d /usr/local/emhttp/plugins/nut ]; then echo "Now removing the remaining parts of the previous NUT configuration layout..." rm -rf /usr/local/emhttp/plugins/nut fi # reading our configuration echo "Reading NUT configuration..." if [ -e "$CONFIG" ]; then source "$CONFIG" fi # determine if config wants NUT services to start echo "Determining if NUT services should be started..." if [ "$MODE" != "slave" ] && [ "$DRIVER" == "snmp-ups" ]; then if [ "$SERVICE" == "enable" ]; then echo "SNMP driver is configured, starting NUT services in background instead (see SYSLOG)..." at -M now <<< "/etc/rc.d/rc.nut start 2>&1 | logger -t \"rc.nut\"" elif [ "$STATISTICS" == "enable" ]; then echo "SNMP driver is configured, starting NUT statistic services in background instead (see SYSLOG)..." at -M now <<< "/etc/rc.d/rc.nutstats check 2>&1 | logger -t \"rc.nutstats\"" fi else if [ "$SERVICE" == "enable" ]; then echo "Starting NUT services..." /etc/rc.d/rc.nut start 2>&1 | logger -t "rc.nut" if [ "${PIPESTATUS[0]}" -eq 0 ]; then echo "NUT services have been started successfully." else echo "WARNING: NUT services failed to start, check your configuration and the SYSLOG." fi elif [ "$STATISTICS" == "enable" ]; then echo "Starting NUT statistic services..." /etc/rc.d/rc.nutstats check 2>&1 | logger -t "rc.nutstats" if [ "${PIPESTATUS[0]}" -eq 0 ]; then echo "NUT statistic services have been started successfully." else echo "WARNING: NUT statistic services failed to start, check your configuration and the SYSLOG." fi fi fi /etc/cron.daily/nut-poller conntest >/dev/null 2>&1 & echo "" echo "-----------------------------------------------------------" echo " Network UPS Tools (NUT) for UNRAID has been installed." echo " Version: &version; / Plugin Maintainer: &author;" echo "-----------------------------------------------------------" echo "" echo "Making sure all existing NUT services are stopped (before uninstall)..." if [ -x /etc/rc.d/rc.nut ]; then if ! /etc/rc.d/rc.nut stop >/dev/null 2>&1; then echo "WARNING:" echo "WARNING: The NUT uninstallation script was not able to stop all NUT services gracefully." echo "WARNING: IN CASE OF PROBLEMS, please REBOOT YOUR SYSTEM to remove any remaining packages." echo "WARNING:" fi killall nut-poller >/dev/null 2>&1 fi if [ -x /etc/rc.d/rc.nutstats ]; then if ! /etc/rc.d/rc.nutstats disable >/dev/null 2>&1; then echo "WARNING:" echo "WARNING: The NUT uninstallation script was not able to stop all NUT statistic services gracefully." echo "WARNING: IN CASE OF PROBLEMS, please REBOOT YOUR SYSTEM to remove any remaining packages." echo "WARNING:" fi fi # check if net-snmp is used by another plugin if [ "$(find /boot/config/plugins/*.plg -type f ! -iname "*nut-dw.plg*" | xargs grep "net-snmp" -sl)" ]; then echo "Net-SNMP in use by another plugin, will not be removed with NUT." rm -f &plgPATH;/net-snmp*.txz fi # check if libmodbus is used by another plugin if [ "$(find /boot/config/plugins/*.plg -type f ! -iname "*nut-dw.plg*" | xargs grep "libmodbus" -sl)" ]; then echo "libmodbus in use by another plugin, will not be removed with NUT." rm -f &plgPATH;/libmodbus*.txz fi removepkg &plgPATH;/*.txz # clean up folders after the removed installation # in case of re-installation of package on live system rm -rf &emhttp; rm -f &plgPATH;/*.txz \ &plgPATH;/*.md5 rm -rf /etc/nut rm -rf /etc/ups rm -rf /var/run/nut rm -rf /var/state/ups rm -rf /etc/nutstats if [ -f /boot/config/plugins/dynamix/nutstats.cron ]; then rm -f /boot/config/plugins/dynamix/nutstats.cron sleep 1 update_cron sleep 1 fi if [ -f /etc/rsyslog.d/xnut-nospam.conf ]; then rm -f /etc/rsyslog.d/xnut-nospam.conf sleep 1 /etc/rc.d/rc.rsyslogd restart >/dev/null 2>&1 sleep 1 fi rm -f /etc/cron.daily/nut-poller >/dev/null 2>&1 echo "" echo "-----------------------------------------------------------" echo " Network UPS Tools (NUT) for UNRAID has been removed." echo " Version: &version; / Plugin Maintainer: &author;" echo "-----------------------------------------------------------" echo ""