[arch-projects] [netctl][PATCH] connections/vlan: fix BindsToInterfaces length calculation
${array[@]} requires "[@]" to count the array members. Otherwise it will return the length of the first element which will hardly ever be 1. Signed-off-by: Florian Pritz <bluewind@xinu.at> --- src/lib/connections/vlan | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/connections/vlan b/src/lib/connections/vlan index 86d1a2d..e5edf4a 100644 --- a/src/lib/connections/vlan +++ b/src/lib/connections/vlan @@ -3,7 +3,7 @@ . "$CONN_DIR/ethernet" vlan_up() { - if [[ ${#BindsToInterfaces} -ne 1 ]]; then + if [[ ${#BindsToInterfaces[@]} -ne 1 ]]; then report_error "No unique physical device for VLAN interface '$Interface' specified" return 1 fi -- 1.8.1.5
On Mon, Mar 11, 2013 at 7:40 PM, Florian Pritz <bluewind@xinu.at> wrote:
${#array[@]} requires "[@]" to count the array members. Otherwise it will return the length of the first element which will hardly ever be 1.
Absolutely. Thanks! - Jouke
participants (2)
-
Florian Pritz
-
Jouke Witteveen