d2f1bc19aac055c9475a27d25350eea0eb09cd82
11 config_get sysfs
${cfg} sysfs
12 config_get name
${cfg} name
14 [ -z "${sysfs}" ] && return
16 for tuple
in ${tuples}; do
21 new_sysfs
=$
(echo ${sysfs} | sed "s/${old}/${new}/")
23 [ "${new_sysfs}" = "${sysfs}" ] && continue
25 uci set system.${cfg}.sysfs="${new_sysfs}"
27 logger -t led-migration "sysfs option of LED
\"${name}\" updated to
${new_sysfs}"
31 remove_devicename_led_sysfs() {
38 config_get sysfs ${cfg} sysfs
39 config_get name ${cfg} name
41 # only continue if two or more colons are present
42 echo "${sysfs}" | grep -q ":.
*:" || return
44 for exception in ${exceptions}; do
45 # no change if exceptions provided as argument are found for devicename
46 echo "${sysfs}" | grep -q "^
${exception}:" && return
49 new_sysfs=$(echo ${sysfs} | sed "s
/^
[^
:]*://")
51 uci set system.${cfg}.sysfs="${new_sysfs}"
53 logger -t led-migration "sysfs option of LED
\"${name}\" updated to
${new_sysfs}"
58 config_foreach migrate_led_sysfs led "$@
"
61 remove_devicename_leds() {
63 config_foreach remove_devicename_led_sysfs led "$@
"
68 [ -n "$
(uci changes
${realm})" ] && uci -q commit ${realm}