3.0.0
This commit is contained in:
commit
645c461d2a
12 files changed
+886
No files matched your search
@@ -0,0 +1,37 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=99
|
||||
STOP=10
|
||||
|
||||
time_is_sane() {
|
||||
local year
|
||||
year="$(date +%Y 2>/dev/null)"
|
||||
[ -n "$year" ] || return 1
|
||||
[ "$year" -ge 2024 ] 2>/dev/null
|
||||
}
|
||||
|
||||
start() {
|
||||
/usr/bin/led-control sync >/dev/null 2>&1
|
||||
|
||||
# Keep LEDs in their normal OpenWrt state until the clock is trustworthy.
|
||||
/usr/bin/led-control on >/dev/null 2>&1
|
||||
|
||||
if time_is_sane; then
|
||||
/usr/bin/led-control apply >/dev/null 2>&1
|
||||
else
|
||||
logger -t led-scheduler "boot clock not synchronized; waiting for NTP"
|
||||
fi
|
||||
}
|
||||
|
||||
reload() {
|
||||
start
|
||||
}
|
||||
|
||||
restart() {
|
||||
start
|
||||
}
|
||||
|
||||
stop() {
|
||||
/usr/bin/led-control clear-cron >/dev/null 2>&1
|
||||
/usr/bin/led-control on >/dev/null 2>&1
|
||||
}
|
||||
Reference in new issue
Block a user