mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-10-30 18:07:52 +00:00
* rename eap6x0 to exxx7 * update schema * update client * update gateway * update usteer * implement all missing ucentral commands * patch the led script to allow turning of all leds Signed-off-by: John Crispin <john@phrozen.org>
54 lines
1.2 KiB
Diff
54 lines
1.2 KiB
Diff
From 43f1072a42dd19a0718c44c58daf3f9e5a3c9421 Mon Sep 17 00:00:00 2001
|
|
From: John Crispin <john@phrozen.org>
|
|
Date: Mon, 19 Apr 2021 13:49:20 +0200
|
|
Subject: [PATCH] base-files: add a turnoff command to the led script
|
|
|
|
Signed-off-by: John Crispin <john@phrozen.org>
|
|
---
|
|
package/base-files/files/etc/init.d/led | 15 +++++++++++++++
|
|
1 file changed, 15 insertions(+)
|
|
|
|
diff --git a/package/base-files/files/etc/init.d/led b/package/base-files/files/etc/init.d/led
|
|
index 8d97515d52..9f7930feed 100755
|
|
--- a/package/base-files/files/etc/init.d/led
|
|
+++ b/package/base-files/files/etc/init.d/led
|
|
@@ -3,6 +3,8 @@
|
|
|
|
START=96
|
|
|
|
+extra_command "turnoff" "Turn all leds off"
|
|
+
|
|
load_led() {
|
|
local name
|
|
local sysfs
|
|
@@ -122,7 +124,18 @@ load_led() {
|
|
}
|
|
}
|
|
|
|
+turnoff() {
|
|
+ for led in `ls /sys/class/leds/`; do
|
|
+ echo none > /sys/class/leds/$led/trigger
|
|
+ echo 0 > /sys/class/leds/$led/brightness
|
|
+ done
|
|
+}
|
|
+
|
|
start() {
|
|
+ [ "$(uci get system.@system[-1].leds_off)" -eq 1 ] && {
|
|
+ turnoff
|
|
+ exit 0
|
|
+ }
|
|
[ -e /sys/class/leds/ ] && {
|
|
[ -s /var/run/led.state ] && {
|
|
local led trigger brightness
|
|
@@ -138,5 +151,7 @@ start() {
|
|
|
|
config_load system
|
|
config_foreach load_led led
|
|
+ . /etc/diag.sh
|
|
+ set_state done
|
|
}
|
|
}
|
|
--
|
|
2.25.1
|
|
|