mirror of
https://github.com/Telecominfraproject/ols-ucentral-schema.git
synced 2025-10-30 01:32:26 +00:00
16 lines
277 B
Ucode
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");
|