Files
ols-ucentral-schema/command/cmd_leds.uc
John Crispin 81f1886bea convert system and command scripts to raw mode
Signed-off-by: John Crispin <john@phrozen.org>
2022-04-20 15:02:25 +02:00

16 lines
277 B
Ucode

function set_led(val, path)
{
let cursor = uci.cursor(path);
cursor.set("system", "@system[-1]", "leds_off", val);
cursor.commit();
}
let val = 0;
if (args.pattern == "off")
val = 1;
set_led(val);
set_led(val, "/etc/config-shadow/");
system("/etc/init.d/led restart");