From eced3b3a355199e1a1b51cba41689d9336d95c40 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Fri, 26 Feb 2016 14:49:17 +0000 Subject: base-files: support passing mode to ucidef_set_led_netdev() Signed-off-by: Jo-Philipp Wich SVN-Revision: 48806 --- package/base-files/files/bin/config_generate | 6 +++--- package/base-files/files/lib/functions/uci-defaults.sh | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'package/base-files/files') diff --git a/package/base-files/files/bin/config_generate b/package/base-files/files/bin/config_generate index 865dccc450..550de0eebf 100755 --- a/package/base-files/files/bin/config_generate +++ b/package/base-files/files/bin/config_generate @@ -263,11 +263,11 @@ generate_led() { ;; netdev) - local device - json_get_vars device + local device mode + json_get_vars device mode uci -q batch <<-EOF set system.$cfg.trigger='netdev' - set system.$cfg.mode='link tx rx' + set system.$cfg.mode='$mode' set system.$cfg.dev='$device' EOF ;; diff --git a/package/base-files/files/lib/functions/uci-defaults.sh b/package/base-files/files/lib/functions/uci-defaults.sh index d556844e95..512e0ed8bd 100755 --- a/package/base-files/files/lib/functions/uci-defaults.sh +++ b/package/base-files/files/lib/functions/uci-defaults.sh @@ -355,6 +355,7 @@ ucidef_set_led_netdev() { local name="$2" local sysfs="$3" local dev="$4" + local mode="${5:-link tx rx}" json_select_object led @@ -363,6 +364,7 @@ ucidef_set_led_netdev() { json_add_string type netdev json_add_string sysfs "$sysfs" json_add_string device "$dev" + json_add_string mode "$mode" json_select .. json_select .. -- cgit v1.2.3