blob: c0547f7a094e5aca37c40d337d786f6eb45529b2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
tag:
type: txt
help: Set ethernet interface
syntax:expression: exec " \
if [ -z \"`ip link | grep eth | egrep -v 'eth[0-9]+[.]' | grep $VAR(@)`\" ]; then \
echo Invalid ethernet interface [$VAR(@)]; \
exit 1 ; \
fi ; "
update: sudo ip link set "$VAR(@)" up
${vyatta_sbindir}/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/*;
do if [[ -d $dev && -L $dev/device ]]
then if [[ $(cat $dev/type) -eq 1 ]]
then echo -n ${dev##*/} " "
fi
fi
done
|