diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2015-11-26 13:53:02 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2015-11-26 13:53:02 +0000 |
commit | bc095ba4055bcff07ebbcbe646a9d2a1d94d7b8b (patch) | |
tree | 75eae259e9dd44d4dbbcf247eab9341312dc53f5 /package/base-files | |
parent | 8e2bb5834d3db2905386a80e96d27106e3eb6bc2 (diff) | |
download | master-187ad058-bc095ba4055bcff07ebbcbe646a9d2a1d94d7b8b.tar.gz master-187ad058-bc095ba4055bcff07ebbcbe646a9d2a1d94d7b8b.tar.bz2 master-187ad058-bc095ba4055bcff07ebbcbe646a9d2a1d94d7b8b.zip |
base-files: config_generate: regroup led generator code
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@47659 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/base-files')
-rwxr-xr-x | package/base-files/files/bin/config_generate | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/package/base-files/files/bin/config_generate b/package/base-files/files/bin/config_generate index 45bf77b5cf..a0ff53a72c 100755 --- a/package/base-files/files/bin/config_generate +++ b/package/base-files/files/bin/config_generate @@ -293,36 +293,40 @@ generate_led() { json_select led json_select "$key" - json_get_vars name sysfs type trigger device default port_mask + json_get_vars name sysfs type trigger default uci -q batch <<-EOF delete system.$cfg set system.$cfg='led' set system.$cfg.name='$name' set system.$cfg.sysfs='$sysfs' - set system.$cfg.dev='$device' set system.$cfg.trigger='$trigger' - set system.$cfg.port_mask='$port_mask' set system.$cfg.default='$default' EOF case "$type" in netdev) + local device + json_get_vars device uci -q batch <<-EOF set system.$cfg.trigger='netdev' set system.$cfg.mode='link tx rx' + set system.$cfg.dev='$device' EOF ;; usb) + local device + json_get_vars device uci -q batch <<-EOF set system.$cfg.trigger='usbdev' set system.$cfg.interval='50' + set system.$cfg.dev='$device' EOF ;; rssi) - local minq maxq offset factor + local iface minq maxq offset factor json_get_vars iface minq maxq offset factor uci -q batch <<-EOF set system.$cfg.trigger='rssi' @@ -333,6 +337,14 @@ generate_led() { set system.$cfg.factor='$factor' EOF ;; + + switch) + local port_mask + json_get_vars port_mask + uci -q batch <<-EOF + set system.$cfg.port_mask='$port_mask' + EOF + ;; esac json_select .. |