UNVR-NAS/overlay/filesystem/usr/lib/init/boot/ubnt-ulcmd.sh
Chris Blake 116b6591a9 fix: improvements across the board
* Update README.md, make sure the disclaimer is seen before install instructions.
* update ustorage to have temp readings on some samsung ssds (stupid samsung)
* Patch and support ulcmd relying on output from ubnteeprom
* Move away from ubnthal FINALLY now that we patched ulcmd (hacky but works!)
* added README.md to ubnteeprom, since I expect at somepoint folks will fork/use it for other projects.
* Added our own kernel module to force mtd's RO, which does a better job than ubnthal did :)
2024-06-16 13:50:44 -05:00

28 lines
909 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")
# Ensure our tmp file with info is generated
ubnteeprom -systeminfo > /tmp/.ubnthal_system_info
# 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