UNVR-NAS/overlay/filesystem/usr/lib/init/boot/ubnt-ulcmd.sh
Chris Blake 3f90bd2357
feat: Add UNVR support (#11)
* Move partition mounts to PARTLABEL instead of paths
* Add dual firmware building support, specify the build type using the BOARD env var when using make
* Update to Unifi 4.0.5 pre-release firmware
* Move ulcmd init to be our "user interface" setup script, will handle LEDs on the UNVR4 in the future
* Update README with updated instructions
* Add udev rules to support /dev/boot which is what Unifi uses for some stupid reason for their emmc. This is required for systemd to mount correctly after chroot.
* Fixup small bugs found along the way
2024-06-15 18:53:44 -05:00

26 lines
799 B
Bash
Executable file

#!/bin/bash
# ULCMD wrapper, used to start ulcmd on the UNVR Pro, or setup the status LED on the UNVR-4
case "$(ubnteeprom -systeminfo -key shortname)" in
"UNVRPRO")
# Is ulcmd running already? if so, assume it was not done via systemd so let's
# kill and respawn as this is our systemd entry script for the service, and we
# need to have it foregrounded as we act as the "daemon" here.
if ! pidof -q ulcmd; then
killall ulcmd
fi
# Restart ulcmd
exec ulcmd
;;
"UNVR4")
# TODO: LED setup (2=white, 1=blue) against /sys/class/leds/ulogo_ctrl
# Start our "daemon" loop so systemd stays happy
while true; do
sleep 3600
done
;;
*)
exit 1
;;
esac