mirror of
https://github.com/riptidewave93/UNVR-NAS.git
synced 2025-03-09 15:40:13 +00:00
fix: migrate UNVR init logic
Let's keep ulcmd for the pro only, and move LED stuff elsewhere.
This commit is contained in:
parent
24d98456e6
commit
6f01afd72b
5 changed files with 26 additions and 29 deletions
|
@ -1,29 +1,16 @@
|
|||
#!/bin/bash
|
||||
|
||||
# ULCMD wrapper, used to start ulcmd on the UNVR Pro, or setup the status LED on the UNVR-4
|
||||
# ULCMD wrapper, used to start ulcmd on the UNVR Pro
|
||||
|
||||
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")
|
||||
# 2=white, 1=blue, 0=off, needs a value set with :x for ms
|
||||
echo 1:500 > /sys/class/leds/ulogo_ctrl/pattern
|
||||
# Start our "daemon" loop so systemd stays happy
|
||||
while true; do
|
||||
sleep 3600
|
||||
done
|
||||
;;
|
||||
*)
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
# Ensure our tmp file with info is generated for our patched ulcmd
|
||||
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
|
||||
|
||||
# Start ulcmd
|
||||
exec ulcmd
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue