From 1f35eb3e42b883b5ec992b355818f1335dc2fc38 Mon Sep 17 00:00:00 2001 From: Mykola Malkov Date: Tue, 8 May 2018 11:45:17 +0200 Subject: [PATCH] TT#32751 Get VLAN params from current network config If VLAN is configured via netcardconfig we can get required params only from interface. Change-Id: Ia1697ca5a153bc91ba98f9055b359ff7bae84753 --- templates/scripts/includes/deployment.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/templates/scripts/includes/deployment.sh b/templates/scripts/includes/deployment.sh index 78dd170..6dcf3a1 100755 --- a/templates/scripts/includes/deployment.sh +++ b/templates/scripts/includes/deployment.sh @@ -386,6 +386,14 @@ if checkBootParam vlan ; then VLANIF=${VLANPARAMS[1]} fi fi +# if VLAN was configured via netcardconfig we need to collect the current configuration +# from interface +vlan_config=( $(ip link show | sed -rn 's/^[0-9]+: vlan([0-9]+)@([a-z0-9]+):.+$/\1 \2/p') ) +if [[ "${#vlan_config[@]}" -eq 2 ]]; then + VLAN=true + VLANID=${vlan_config[0]} + VLANIF=${vlan_config[1]} +fi if checkBootParam ngcpmgmt ; then MANAGEMENT_IP=$(getBootParam ngcpmgmt)