summaryrefslogtreecommitdiff
path: root/templates/interfaces/ethernet/node.def
blob: 3023a70b73ef91d7e72e4238c400edaefb2f75b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
tag:
type: txt
help: Set ethernet interface
syntax:expression: pattern $VAR(@) "^eth[0-9]+$" \
		   ; "interface must be (eth0 - eth999)"
syntax:expression: exec " \
	if [ -f /sys/class/net/$VAR(@) ]; then \
	echo \"Ethernet interface does not exist: $VAR(@)\"; \
	exit 1; \
	fi"

update: sudo ip link set "$VAR(@)" up
        vyatta-vtysh -c "configure terminal" \
          -c "interface $VAR(@)" -c "link-detect"
delete: sudo ip link set "$VAR(@)" down
allowed: for dev in /sys/class/net/eth*; 
         do if [[ -d $dev && -L $dev/device ]]
	    then echo -n ${dev##*/} " "
            fi
         done