summaryrefslogtreecommitdiff
path: root/templates/interfaces/bridge/node.def
blob: 1ac499db60b59b50c67476c1ba3a383d04a37552 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
priority: 310
tag:
type: txt
help: Set bridge interface

syntax:expression: pattern $VAR(@) "^br[0-9]+$" ; "Must be (br0 - br999)"

create: sudo brctl addbr $VAR(@)
        sudo ip link set $VAR(@) up

delete: if [ -n "`ls /sys/class/net/$VAR(@)/brif`" ]; then
	   echo "Interfaces are still assigned to bridge $VAR(@)";
           exit 1;           
        fi;
        sudo ip link set $VAR(@) down;
        sudo brctl delbr $VAR(@);

comp_help: "Enter bridge interface name (br0 - br999)"