diff options
Diffstat (limited to 'templates/interfaces')
3 files changed, 18 insertions, 3 deletions
diff --git a/templates/interfaces/bonding/node.tag/vif-s/node.tag/ethertype/node.def b/templates/interfaces/bonding/node.tag/vif-s/node.tag/ethertype/node.def index e8a1e810..a79acae4 100644 --- a/templates/interfaces/bonding/node.tag/vif-s/node.tag/ethertype/node.def +++ b/templates/interfaces/bonding/node.tag/vif-s/node.tag/ethertype/node.def @@ -7,7 +7,12 @@ comp_help: possible completions: 0x88A8 802.1AD 0x8100 802.1Q -update: ETHERTYPE=`echo "$VAR(@)"` +update: ACTIVEETHTYPE=`cli-shell-api returnActiveValue interfaces bonding $VAR(../../@) vif-s $VAR(../@) ethertype` + if [ ! -z $VAR(../vif-c/@@) ] && [ ! -z $ACTIVEETHTYPE ] + then echo "Can not change ethertype with vif-c configured" + exit 1 + fi + ETHERTYPE=`echo "$VAR(@)"` if [ $ETHERTYPE == "0x88A8" ]; then ETHTYPE=802.1ad; fi if [ $ETHERTYPE == "0x8100" ]; then ETHTYPE=802.1Q; fi read -a SLAVES </sys/class/net/$VAR(../../@)/bonding/slaves diff --git a/templates/interfaces/ethernet/node.tag/vif-s/node.tag/ethertype/node.def b/templates/interfaces/ethernet/node.tag/vif-s/node.tag/ethertype/node.def index 9a3615be..0a5e954a 100644 --- a/templates/interfaces/ethernet/node.tag/vif-s/node.tag/ethertype/node.def +++ b/templates/interfaces/ethernet/node.tag/vif-s/node.tag/ethertype/node.def @@ -7,7 +7,12 @@ comp_help: possible completions: 0x88A8 802.1AD 0x8100 802.1Q -update: ETHERTYPE=`echo "$VAR(@)"` +update: ACTIVEETHTYPE=`cli-shell-api returnActiveValue interfaces ethernet $VAR(../../@) vif-s $VAR(../@) ethertype` + if [ ! -z $VAR(../vif-c/@@) ] && [ ! -z $ACTIVEETHTYPE ] + then echo "Can not change ethertype with vif-c configured" + exit 1 + fi + ETHERTYPE=`echo "$VAR(@)"` if [ $ETHERTYPE == "0x88A8" ]; then ETHTYPE=802.1ad; fi if [ $ETHERTYPE == "0x8100" ]; then ETHTYPE=802.1Q; fi ip link delete dev "$VAR(../../@).$VAR(../@)" type vlan proto $ETHTYPE id $VAR(../@) > /dev/null 2>&1 diff --git a/templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/ethertype/node.def b/templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/ethertype/node.def index 54ff166c..9e2d5a54 100644 --- a/templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/ethertype/node.def +++ b/templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/ethertype/node.def @@ -7,7 +7,12 @@ comp_help: possible completions: 0x88A8 802.1AD 0x8100 802.1Q -update: ETHERTYPE=`echo "$VAR(@)"` +update: ACTIVEETHTYPE=`cli-shell-api returnActiveValue interfaces pseudo-ethernet $VAR(../../@) vif-s $VAR(../@) ethertype` + if [ ! -z $VAR(../vif-c/@@) ] && [ ! -z $ACTIVEETHTYPE ] + then echo "Can not change ethertype with vif-c configured" + exit 1 + fi + ETHERTYPE=`echo "$VAR(@)"` if [ $ETHERTYPE == "0x88A8" ]; then ETHTYPE=802.1ad; fi if [ $ETHERTYPE == "0x8100" ]; then ETHTYPE=802.1Q; fi ip link delete dev "$VAR(../../@).$VAR(../@)" type vlan proto $ETHTYPE id $VAR(../@) > /dev/null 2>&1 |