#!/usr/bin/env bash # # Get a UGREEN US3000 UPS reporting properly on TrueNAS SCALE # https://www.zadran.net/guides/ugreen-us3000-ups-on-truenas-scale # Generated from the guide, last updated 2026-09-12. # # NO WARRANTY. This script is provided as is. You are responsible for # understanding what it does before running it, and for the consequences. # Take a backup first. See https://www.zadran.net/disclaimer # # Destructive steps are left commented out on purpose -- uncomment them # only once you have understood what they do. set -euo pipefail # ---- Set these for your environment ---- # Must be on a pool - the root filesystem is read-only and wiped by updates INSTALL_DIR='/mnt/tank/apps/ugreen-ups-driver' # The name NUT knows the UPS by UPS_NAME='ugreen' # Port the driver serves the NUT protocol on NUT_PORT='3494' lsusb | grep -i 2b89 mkdir -p ${INSTALL_DIR} cd ${INSTALL_DIR} cd ${INSTALL_DIR} git clone https://github.com/meestaben/ugreen-ups-driver.git . cd ${INSTALL_DIR} curl -L -o ugreen-ups.zip https://github.com/meestaben/ugreen-ups-driver/archive/refs/heads/main.zip unzip ugreen-ups.zip mv ugreen-ups-driver-main/* . rm -rf ugreen-ups-driver-main ugreen-ups.zip cd ${INSTALL_DIR} chmod +x install-ugreen-ups.sh ./install-ugreen-ups.sh install ${INSTALL_DIR} systemctl status ugreen-ups-driver --no-pager upsc ${UPS_NAME}@localhost:${NUT_PORT} journalctl -u ugreen-ups-driver -f sudo reboot systemctl status ugreen-ups-driver --no-pager upsc ${UPS_NAME}@localhost:${NUT_PORT} ups.status # !! DESTRUCTIVE -- review, then uncomment to run: # cd ${INSTALL_DIR} # ./install-ugreen-ups.sh uninstall ${INSTALL_DIR}