diff options
author | Stig Thormodsrud <stig@io.vyatta.com> | 2009-03-04 18:04:41 -0800 |
---|---|---|
committer | Stig Thormodsrud <stig@io.vyatta.com> | 2009-03-04 18:04:41 -0800 |
commit | 45a5466e2225494d237243689f666eb34d85d34e (patch) | |
tree | 60c3275f5abcb538afcbade185a95d641a3d7e05 /templates | |
parent | b6e48dd4171703e403626c5506c0607b1ec6327a (diff) | |
parent | 6d5458fbd0cfbcc3b4b16f4d3d6682dd474d60b6 (diff) | |
download | vyatta-cfg-45a5466e2225494d237243689f666eb34d85d34e.tar.gz vyatta-cfg-45a5466e2225494d237243689f666eb34d85d34e.zip |
Merge branch 'jenner' of http://git.vyatta.com/vyatta-cfg into jenner
Diffstat (limited to 'templates')
-rw-r--r-- | templates/interfaces/ethernet/node.def | 16 | ||||
-rw-r--r-- | templates/interfaces/loopback/node.def | 13 | ||||
-rw-r--r-- | templates/priority | 22 |
3 files changed, 17 insertions, 34 deletions
diff --git a/templates/interfaces/ethernet/node.def b/templates/interfaces/ethernet/node.def index 1886458..c231b74 100644 --- a/templates/interfaces/ethernet/node.def +++ b/templates/interfaces/ethernet/node.def @@ -1,19 +1,9 @@ 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" - +syntax:expression: exec \ + "/opt/vyatta/sbin/vyatta-interfaces.pl --dev=$VAR(@) --check=ethernet" +allowed: /opt/vyatta/sbin/vyatta-interfaces.pl --show=ethernet update: sudo ip link set "$VAR(@)" up /opt/vyatta/sbin/vyatta-link-detect $VAR(@) on 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 diff --git a/templates/interfaces/loopback/node.def b/templates/interfaces/loopback/node.def index e57f4b1..690dc39 100644 --- a/templates/interfaces/loopback/node.def +++ b/templates/interfaces/loopback/node.def @@ -1,14 +1,7 @@ tag: type: txt help: Set loopback interface -allowed: echo "lo" -syntax:expression: exec "\ - if [ ! -d /sys/class/net/$VAR(@) ]; then \ - echo \"loopback interface $VAR(@) does not exist\"; \ - exit 1; \ - elif [ $(cat /sys/class/net/$VAR(@)/type) -ne 772 ]; then \ - echo \"interface $VAR(@) is not a loopback interface\"; \ - exit 1; \ - fi" - +syntax:expression: exec \ + "/opt/vyatta/sbin/vyatta-interfaces.pl --dev=$VAR(@) --check=loopback" +allowed: /opt/vyatta/sbin/vyatta-interfaces.pl --show=loopback update: sudo ip link set $VAR(@) up diff --git a/templates/priority b/templates/priority index fe4babd..3ba0cd6 100644 --- a/templates/priority +++ b/templates/priority @@ -4,21 +4,21 @@ 301 protocols/ospfv3 302 protocols/rip 303 protocols/ripng -310 interfaces/bridge/node.tag -320 interfaces/ethernet/node.tag -320 interfaces/loopback/node.tag -330 interfaces/adsl/node.tag -340 interfaces/serial/node.tag -350 interfaces/wirelessmodem/node.tag -380 interfaces/tunnel/node.tag -380 interfaces/openvpn/node.tag -390 interfaces/bonding/node.tag +310 interfaces/bridge +315 interfaces/bonding +320 interfaces/ethernet +320 interfaces/loopback +330 interfaces/adsl +340 interfaces/serial +350 interfaces/wirelessmodem +380 interfaces/tunnel +380 interfaces/openvpn 400 system 450 protocols/static 470 policy -500 protocols/bgp/node.tag +500 protocols/bgp 510 protocols/bgp/node.tag/parameters -520 protocols/bgp/node.tag/neighbor/node.tag +520 protocols/bgp/node.tag/neighbor 530 protocols/bgp/node.tag/ipv6 530 protocols/bgp/node.tag/network 530 protocols/bgp/node.tag/redistribute |