Small, single-file Bash installer for the ugreen_leds_controller project. It clones, installs the kernel module, copies helper scripts and a systemd unit, and enables the service.
Always validate what the script does before running
Run the following command to install:
curl -sf https://raw.githubusercontent.com/0x556c79/install_ugreen_leds_controller/main/install_ugreen_leds_controller.sh -o install_ugreen_leds_controller.sh ; sudo bash install_ugreen_leds_controller.shThis installer has been confirmed working on the following models. For general module compatibility (other OS/distros), refer to the upstream project.
| Model | Notes | Reference |
|---|---|---|
| UGREEN DX4600+ | Tested with TrueNAS SCALE 25.04.2.6 | #20 |
| UGREEN DXP2800 | #12 | |
| UGREEN DXP3800 Plus | Tested with TrueNAS SCALE 25.10.3 | #18 |
| UGREEN DXP4700 | Tested with TrueNAS SCALE 25.10.4 | — |
| UGREEN DXP4800 | Tested with TrueNAS SCALE 25.04.2.5, script v1.0 | #6 |
| UGREEN NASync DXP4800 Pro | Customization configuration also tested | #24 |
| UGREEN DXP6800 Pro | Tested with TrueNAS SCALE 25.10.3 | #17 |
| UGREEN DXP8800 Plus | Developed & tested on this model | — |
| UGREEN NASync iDX6011 Pro | Experimental support; different LED protocol, interim TrueNAS modules built from the iDX fork | #23 |
If you've confirmed the script works on another model, feel free to open an issue or pull request!
The iDX6011/iDX6012 series uses a different LED protocol than the DX/DXP models. The installer defaults to --controller-source auto, which checks the DMI product name and selects the iDX profile only for iDX6011 or iDX6012.
sudo bash install_ugreen_leds_controller.sh --controller-source auto
sudo bash install_ugreen_leds_controller.sh --controller-source idx6011 # force iDX profile
sudo bash install_ugreen_leds_controller.sh --controller-source upstream # force DX/DXP upstream profileUntil iDX support is merged upstream, the iDX profile expects TrueNAS kernel modules built from klein0r/ugreen_leds_controller and published on the temporary idx6011-kmods artifact branch in this repository. The build-idx6011-truenas-kmods GitHub Actions workflow builds missing artifacts for the supported TrueNAS SCALE trains (24.04, 24.10, 25.04, and 25.10) from pinned source commit 480f114bae69ec2bb7003df5d9c13f788ca6ace6. When upstream publishes compatible artifacts, only the profile constants in the installer should need to change.
For iDX network LEDs, the installed monitor auto-detects network_stat and network_stat2. Optional overrides can be set in /etc/ugreen-leds.conf:
NETDEV_LED_NAMES="network_stat network_stat2"
NETDEV_INTERFACE_NAMES="enp1s0 enp2s0"NEW: The installer now supports TrueNAS Scale systems with read-only root filesystems (common when Nvidia drivers are installed).
- ✅ Persistent Storage: Stores kernel module and scripts on a writable ZFS pool location
- ✅ Version Tracking: Only downloads kernel modules when TrueNAS version changes
- ✅ Smart Reuse: Reuses existing files on subsequent boots (no re-download)
- ✅ Auto-Recovery: Survives TrueNAS updates when configured as Init Script
- ✅ Config Preservation: Your
/etc/ugreen-leds.confsettings always persist
/mnt/ (on a ZFS pool) to ensure persistence across reboots on TrueNAS Scale. The script will abort if run from outside /mnt/.
The script intelligently detects the persistent directory location:
-
Script in
leds_controller/directory: If the script is already located in a folder namedleds_controller, this folder is used as the persistent directory.# Example: Script is at /mnt/tank/apps/leds_controller/install_ugreen_leds_controller.sh cd /mnt/tank/apps/leds_controller sudo bash install_ugreen_leds_controller.sh --yes
-
Existing
leds_controller/at same level: If aleds_controllerdirectory exists at the same level as the script, it will be reused.# Example: Script is at /mnt/tank/apps/install_ugreen_leds_controller.sh # and /mnt/tank/apps/leds_controller/ already exists cd /mnt/tank/apps sudo bash install_ugreen_leds_controller.sh --yes
-
New installation: If neither condition above is met, the script creates a new
leds_controller/directory.
cd /mnt/<POOL>/<DATASET>/<FOLDER>
sudo bash install_ugreen_leds_controller.shThe installer will prompt you to choose a persistent storage location.
cd /mnt/<POOL>/<DATASET>/<FOLDER>
sudo bash install_ugreen_leds_controller.sh --use-current-dirCreates leds_controller/ in your current directory.
sudo bash install_ugreen_leds_controller.sh --pool-path <POOL>/<DATASET>/<FOLDER>Example: --pool-path tank/apps/ugreen
sudo bash install_ugreen_leds_controller.sh --persist-dir /mnt/<POOL>/<PATH>/leds_controllerTo ensure LED controller starts after every reboot:
-
Copy the installer to the persistent directory (if not already there):
cp install_ugreen_leds_controller.sh /mnt/<POOL>/<PATH>/leds_controller/
-
Navigate to System Settings → Advanced → Init/Shutdown Scripts
-
Click Add
-
Configure:
- Description:
UGREEN LED Controller - Type:
Command - Command:
/bin/bash /mnt/<POOL>/<PATH>/leds_controller/install_ugreen_leds_controller.sh --yes - When:
Post Init - Enabled: ✓ (checked)
- Timeout:
10seconds
- Description:
-
Click Save
Why this works:
- The script detects it's running from inside the
leds_controller/directory - It uses that directory as the persistent storage location
- The
--yesflag enables non-interactive mode for automated execution - Version tracking ensures fast subsequent boots (~3-5 seconds, no re-download)
The installer creates the following structure:
/mnt/<POOL>/<PATH>/leds_controller/
├── .version # TrueNAS version tracker
├── led-ugreen.ko # Kernel module
├── install_ugreen_leds_controller.sh # Installer copy for reuse
├── ugreen_leds_controller/ # Cloned repository
│ └── scripts/
└── scripts/ # Installed scripts
├── ugreen-diskiomon
├── ugreen-netdevmon
├── ugreen-probe-leds
└── ugreen-power-led
/etc/ugreen-leds.conf # Your configuration (writable)
The installer automatically handles configuration in the following priority order:
- Existing persistent config: Uses
${PERSIST_DIR}/ugreen-leds.confif it exists - Existing system config: Migrates
/etc/ugreen-leds.confto persistent directory (preserves your settings) - Template config: Uses repository template for new installations
Migration Note: If you have an existing /etc/ugreen-leds.conf from a standard installation, it will be automatically detected and copied to your persistent directory on first run, preserving all your custom settings.
Options:
-h Print help message
-v <version> Use specific TrueNAS version (e.g., 24.10.0)
--persist-dir <path> Specify custom persistent storage directory
--use-current-dir Use current working directory for leds_controller/ folder
--pool-path <path> Specify ZFS pool path under /mnt/
--controller-source <auto|upstream|idx6011>
Select controller source profile (default: auto)
--uninstall Fully uninstall: stop services, unload modules, remove files
--dry-run Show actions without making changes
--yes Non-interactive mode (assume yes to all prompts)
--force Allow destructive actions
To preview the uninstall (no changes made):
sudo bash install_ugreen_leds_controller.sh --uninstall --dry-runTo fully uninstall:
sudo bash install_ugreen_leds_controller.sh --uninstallFor non-interactive uninstall (skips confirmation prompts):
sudo bash install_ugreen_leds_controller.sh --uninstall --yesThe uninstaller reverses all installation steps: stops services, removes service files, unloads kernel modules, removes configs, scripts, and optionally deletes the persistent directory. No internet access is required.
- First Run: Downloads kernel module, installs scripts, copies installer
- Subsequent Runs: Checks version tracker, reuses existing files if version matches
- Version Change: Automatically downloads new kernel module when TrueNAS updates
- Read-Only Detection: Automatically adapts to read-only
/usrfilesystem
Check service status:
systemctl status ugreen-diskiomon.service
systemctl status ugreen-netdevmon@<interface>.serviceView installer logs:
ls -lh /mnt/<POOL>/<PATH>/leds_controller/
cat /mnt/<POOL>/<PATH>/leds_controller/.versionForce module re-download:
rm /mnt/<POOL>/<PATH>/leds_controller/.version
/mnt/<POOL>/<PATH>/leds_controller/install_ugreen_leds_controller.sh --yesVerify module is loaded:
lsmod | grep led_ugreenCheck persistent directory paths in services:
grep ExecStart /etc/systemd/system/ugreen-*.serviceIf you have existing installation in system directories:
- Run the adapted installer with your preferred persistent directory option
- The script will automatically migrate your
/etc/ugreen-leds.confto the persistent directory - Service files are updated to reference the new persistent directory paths
- Old files in
/usr/binremain but are unused - Optionally remove old files:
rm -f /usr/bin/ugreen-* /lib/modules/*/extra/led-ugreen.ko
Your configuration is preserved: The installer detects existing /etc/ugreen-leds.conf and copies it to the persistent directory automatically.
- Full usage, configuration details, and troubleshooting: project Wiki
- Use
--dry-runto preview actions without changing the system - Configuration changes in
/etc/ugreen-leds.confpersist across reboots
Use at your own risk. The author is not responsible for any damage caused by running this script.