]> ###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) # Stop service /usr/local/emhttp/plugins/nut/scripts/rc.nut stop 2>/dev/null # Remove old 'nut-package' file if [ -d "/boot/config/plugins/nut" ]; then rm -f $(ls &path;/&name;-201*.txz 2>/dev/null|grep -v '&version;') fi # Remove old dependencies ??? echo "" echo "-----------------------------------------------------------" echo " Old Plugin &name; was removed (if installed)" echo " Version: &version;" echo "-----------------------------------------------------------" echo "" &pkgURL;expat-2.1.0-x86_64-1.txz &pkgURL;freeipmi-1.4.8-x86_64-1gds.txz &pkgURL;libtool-2.4.6-x86_64-1.txz &pkgURL;libusb-compat-0.1.5-x86_64-1.txz &pkgURL;neon-0.29.6-x86_64-2.txz &pkgURL;net-snmp-5.7.3-x86_64-1.txz &pkgURL;nut-2.7.3-x86_64-1gds.txz &repository;&name;-&version;.txz # Copy default config to persistent directory [ ! -f &path;/&name;.cfg ] && cp /usr/local/emhttp/plugins/&name;/default.cfg &path;/nut.cfg [ ! -f &path;/VERSION ] && touch &path;/VERSION ln -sf /usr/local/emhttp/plugins/nut/scripts/rc.nut /etc/rc.d/rc.nut echo "" echo "-----------------------------------------------------------" echo " Plugin &name; is installed." echo " Version: &version;" echo "-----------------------------------------------------------" echo "" verupgrade=&version; verboot=$( cat &path;/VERSION ) bootenable=$( grep -ic 'SERVICE="enable"' &path;/nut.cfg ) if (( $(echo "$verupgrade $verboot" | awk '{print ($1 == $2)}') )); then echo "" echo "-----------------------------------------------------------" echo " Versions Match, System will handle start of NUT..." echo "-----------------------------------------------------------" echo "" else if [ $bootenable -eq 1 ]; then echo "" echo "-----------------------------------------------------------" echo " Upgrade done, NUT is restarting..." echo "-----------------------------------------------------------" echo "" echo $verupgrade > &path;/VERSION /usr/local/emhttp/plugins/nut/scripts/rc.nut start else echo "" echo "-----------------------------------------------------------" echo " New Install or Upgrade done" echo " NUT is not set to auto start in plugin settings" echo "-----------------------------------------------------------" echo "" echo $verupgrade > &path;/VERSION fi fi # Stop service /usr/local/emhttp/plugins/nut/scripts/rc.&name; stop # Remove plugin related files rm -rf /boot/config/plugins/&name; # Uninstall the 'nut' packages removepkg nut-2.7.3-x86_64-1gds.txz removepkg &name;-&version; echo "" echo "-----------------------------------------------------------" echo " Uninstalled Plugin &name;" echo " Version: &version;" echo "-----------------------------------------------------------" echo ""