diff options
author | An-Cheng Huang <ancheng@vyatta.com> | 2008-01-31 07:56:26 -0800 |
---|---|---|
committer | An-Cheng Huang <ancheng@vyatta.com> | 2008-01-31 07:56:26 -0800 |
commit | cc053cd4a6ba9bbe1842ae9d43c8a332598df2f9 (patch) | |
tree | 7b15cc7b0fd08ef2c445ef184e6db2318968e654 /templates/interfaces | |
parent | b55f0e0cad3152fadcc4b51fe2db7f4ca20a8b99 (diff) | |
download | vyatta-cfg-cc053cd4a6ba9bbe1842ae9d43c8a332598df2f9.tar.gz vyatta-cfg-cc053cd4a6ba9bbe1842ae9d43c8a332598df2f9.zip |
convert templates to new syntax
Diffstat (limited to 'templates/interfaces')
18 files changed, 89 insertions, 89 deletions
diff --git a/templates/interfaces/ethernet/node.def b/templates/interfaces/ethernet/node.def index cfaf798..b42e488 100644 --- a/templates/interfaces/ethernet/node.def +++ b/templates/interfaces/ethernet/node.def @@ -1,15 +1,15 @@ tag: type: txt -help: "Ethernet interface name" -syntax: exec " \ - if [ -z \"`ip link | egrep -v 'eth[0-9]+[.]' | grep $(@)`\" ]; then \ - echo Invalid ethernet interface [$(@)]; \ +help: Ethernet interface name +syntax:expression: exec " \ + if [ -z \"`ip link | egrep -v 'eth[0-9]+[.]' | grep $VAR(@)`\" ]; then \ + echo Invalid ethernet interface [$VAR(@)]; \ exit 1 ; \ fi ; " -update: "sudo ip link set $(@) up" ; "Error enabling dev $(@)" -update: "\\${vyatta_sbindir}/vyatta-vtysh.pl -c \"configure terminal\" -c \"interface $(@)\" \ +update:expression: "sudo ip link set $VAR(@) up" ; "Error enabling dev $VAR(@)" +update:expression: "${vyatta_sbindir}/vyatta-vtysh.pl -c \"configure terminal\" -c \"interface $VAR(@)\" \ -c \"link-detect\"; " -delete: "sudo ip link set $(@) down" ; "Error disabling dev $(@)" -#allowed: local -a array ; -# array=( /sys/class/net/{eth,vmnet}[0-9]+[^.] ) ; -# echo -n ${array[@]##*/} +delete:expression: "sudo ip link set $VAR(@) down" ; "Error disabling dev $VAR(@)" +allowed: local -a array ; + array=( /sys/class/net/{eth,vmnet}[0-9]+[^.] ) ; + echo -n ${array[@]##*/} diff --git a/templates/interfaces/ethernet/node.tag/address/node.def b/templates/interfaces/ethernet/node.tag/address/node.def index af19867..410c072 100644 --- a/templates/interfaces/ethernet/node.tag/address/node.def +++ b/templates/interfaces/ethernet/node.tag/address/node.def @@ -1,10 +1,10 @@ multi: type: txt -help: "Configure an IP address for this interface" -syntax: exec "/opt/vyatta/sbin/vyatta-interfaces.pl --valid-addr $(@) --dev $(../@)"; "Invalid IP address/prefix [$(@)] for interface $(../@)" -update: "sudo /opt/vyatta/sbin/vyatta-interfaces.pl --eth-addr-update $(@) --dev $(../@)"; "Error setting address $(@) on interface $(../@)" -delete: "sudo /opt/vyatta/sbin/vyatta-interfaces.pl --eth-addr-delete $(@) --dev $(../@)"; "Error deleting address $(@) on interface $(../@)" -#comp_help:Possible completions: -# <IP address>/<prefix length>\tSet the IP address and prefix length -# dhcp\t\t\t\tSet the IP address and prefix length via DHCP +help: Configure an IP address for this interface +syntax:expression: exec "/opt/vyatta/sbin/vyatta-interfaces.pl --valid-addr $VAR(@) --dev $VAR(../@)"; "Invalid IP address/prefix [$VAR(@)] for interface $VAR(../@)" +update:expression: "sudo /opt/vyatta/sbin/vyatta-interfaces.pl --eth-addr-update $VAR(@) --dev $VAR(../@)"; "Error setting address $VAR(@) on interface $VAR(../@)" +delete:expression: "sudo /opt/vyatta/sbin/vyatta-interfaces.pl --eth-addr-delete $VAR(@) --dev $VAR(../@)"; "Error deleting address $VAR(@) on interface $VAR(../@)" +comp_help:Possible completions: + <IP address>/<prefix length>\tSet the IP address and prefix length + dhcp\t\t\t\tSet the IP address and prefix length via DHCP diff --git a/templates/interfaces/ethernet/node.tag/description/node.def b/templates/interfaces/ethernet/node.tag/description/node.def index d457185..835ad40 100644 --- a/templates/interfaces/ethernet/node.tag/description/node.def +++ b/templates/interfaces/ethernet/node.tag/description/node.def @@ -1,2 +1,2 @@ type: txt -help: "Description for this interface" +help: Description for this interface diff --git a/templates/interfaces/ethernet/node.tag/disable/node.def b/templates/interfaces/ethernet/node.tag/disable/node.def index 5619908..9c795c6 100644 --- a/templates/interfaces/ethernet/node.tag/disable/node.def +++ b/templates/interfaces/ethernet/node.tag/disable/node.def @@ -1,3 +1,3 @@ -help: "Disable interface" -update: "sudo ip link set $(../@) down"; "Error disabling dev $(../@)" -delete: "sudo ip link set $(../@) up"; "Error enabling dev $(../@)" +help: Disable interface +update:expression: "sudo ip link set $VAR(../@) down"; "Error disabling dev $VAR(../@)" +delete:expression: "sudo ip link set $VAR(../@) up"; "Error enabling dev $VAR(../@)" diff --git a/templates/interfaces/ethernet/node.tag/duplex/node.def b/templates/interfaces/ethernet/node.tag/duplex/node.def index 92fd6e3..a44efd1 100644 --- a/templates/interfaces/ethernet/node.tag/duplex/node.def +++ b/templates/interfaces/ethernet/node.tag/duplex/node.def @@ -1,23 +1,23 @@ type: txt -help: "Set the duplex mode for this interface" +help: Set the duplex mode for this interface default: "auto" -syntax: $(@) in "auto", "half", "full"; "duplex must be auto, half or full" -commit: exec "if [ x$(@) != xauto ]; then \ - if [ x$(../speed/@) == xauto ]; then \ +syntax:expression: $VAR(@) in "auto", "half", "full"; "duplex must be auto, half or full" +commit:expression: exec "if [ x$VAR(@) != xauto ]; then \ + if [ x$VAR(../speed/@) == xauto ]; then \ exit 1; \ fi; \ else \ - if [ x$(../speed/@) != xauto ]; then \ + if [ x$VAR(../speed/@) != xauto ]; then \ exit 1; \ fi; \ fi; " ; "if duplex is hardcoded, speed must also be hardcoded" -update: "if [ x$(@) != xauto ]; then \ - sudo ethtool -s $(../@) speed $(../speed/@) duplex $(@) autoneg off; \ +update:expression: "if [ x$VAR(@) != xauto ]; then \ + sudo ethtool -s $VAR(../@) speed $VAR(../speed/@) duplex $VAR(@) autoneg off; \ else \ - sudo ethtool -s $(../@) autoneg on; \ + sudo ethtool -s $VAR(../@) autoneg on; \ fi; " -delete: "sudo ethtool -s $(../@) autoneg on" -#comp_help:Possible completions: -# auto\t\tAuto negotiation -# half\t\tHalf duplex -# full\t\tFull duplex +delete:expression: "sudo ethtool -s $VAR(../@) autoneg on" +comp_help:Possible completions: + auto\t\tAuto negotiation + half\t\tHalf duplex + full\t\tFull duplex diff --git a/templates/interfaces/ethernet/node.tag/hw-id/node.def b/templates/interfaces/ethernet/node.tag/hw-id/node.def index f0760d6..f25692d 100644 --- a/templates/interfaces/ethernet/node.tag/hw-id/node.def +++ b/templates/interfaces/ethernet/node.tag/hw-id/node.def @@ -1,2 +1,2 @@ type: macaddr -help: "Specify the MAC address of this interface" +help: Specify the MAC address of this interface diff --git a/templates/interfaces/ethernet/node.tag/mac/node.def b/templates/interfaces/ethernet/node.tag/mac/node.def index ef8fae7..909aed8 100644 --- a/templates/interfaces/ethernet/node.tag/mac/node.def +++ b/templates/interfaces/ethernet/node.tag/mac/node.def @@ -1,4 +1,4 @@ type: macaddr -help: "Set the MAC address of this interface" -update: "sudo ip link set $(../@) address $(@)"; "Error setting MAC address on dev $(../@)" -delete: "sudo ip link set $(../@) address $(../hw-id/@)"; "Error setting MAC address on dev $(../@) to $(../hw-id/@)" +help: Set the MAC address of this interface +update:expression: "sudo ip link set $VAR(../@) address $VAR(@)"; "Error setting MAC address on dev $VAR(../@)" +delete:expression: "sudo ip link set $VAR(../@) address $VAR(../hw-id/@)"; "Error setting MAC address on dev $VAR(../@) to $VAR(../hw-id/@)" diff --git a/templates/interfaces/ethernet/node.tag/mtu/node.def b/templates/interfaces/ethernet/node.tag/mtu/node.def index da0a04f..2dd1c39 100644 --- a/templates/interfaces/ethernet/node.tag/mtu/node.def +++ b/templates/interfaces/ethernet/node.tag/mtu/node.def @@ -1,5 +1,5 @@ type: u32 -help: "Set the MTU for this interface" -syntax: $(@) >= 1 && $(@) <= 1500; "MTU must be between 1 and 1500" -update: "sudo ip link set $(../@) mtu $(@)"; "Error setting MTU on dev $(../@)" -delete: "sudo ip link set $(../@) mtu 1500"; "Error deleting MTU on dev $(../@)" +help: Set the MTU for this interface +syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 1500; "MTU must be between 1 and 1500" +update:expression: "sudo ip link set $VAR(../@) mtu $VAR(@)"; "Error setting MTU on dev $VAR(../@)" +delete:expression: "sudo ip link set $VAR(../@) mtu 1500"; "Error deleting MTU on dev $VAR(../@)" diff --git a/templates/interfaces/ethernet/node.tag/smp_affinity/node.def b/templates/interfaces/ethernet/node.tag/smp_affinity/node.def index b24be8c..cd1ef41 100644 --- a/templates/interfaces/ethernet/node.tag/smp_affinity/node.def +++ b/templates/interfaces/ethernet/node.tag/smp_affinity/node.def @@ -1,6 +1,6 @@ multi: type: txt -help: "Set CPU interrupt affinity mask for this interface" -syntax: exec "/opt/vyatta/sbin/vyatta-irqaffin check $(../@) $(@)" -create: "sudo /opt/vyatta/sbin/vyatta-irqaffin set $(../@) $(@)"; "Error setting CPU affinity mask $(@) on interface $(../@)" -delete: "sudo /opt/vyatta/sbin/vyatta-irqaffin reset (../@)"; "Error deleting CPU affinity mask on interface $(../@)" +help: Set CPU interrupt affinity mask for this interface +syntax:expression: exec "/opt/vyatta/sbin/vyatta-irqaffin check $VAR(../@) $VAR(@)" +create:expression: "sudo /opt/vyatta/sbin/vyatta-irqaffin set $VAR(../@) $VAR(@)"; "Error setting CPU affinity mask $VAR(@) on interface $VAR(../@)" +delete:expression: "sudo /opt/vyatta/sbin/vyatta-irqaffin reset (../@)"; "Error deleting CPU affinity mask on interface $VAR(../@)" diff --git a/templates/interfaces/ethernet/node.tag/speed/node.def b/templates/interfaces/ethernet/node.tag/speed/node.def index 652e498..d042074 100644 --- a/templates/interfaces/ethernet/node.tag/speed/node.def +++ b/templates/interfaces/ethernet/node.tag/speed/node.def @@ -1,19 +1,19 @@ type: txt -help: "Set the speed for this interface" +help: Set the speed for this interface default: "auto" -syntax: $(@) in "auto", "10", "100", "1000", "2500", "10000"; "Speed must be auto, 10, 100, 1000, 2500, or 10000" -commit: exec "if [ x$(@) != xauto ]; then \ - if [ x$(../duplex/@) == xauto ]; then \ +syntax:expression: $VAR(@) in "auto", "10", "100", "1000", "2500", "10000"; "Speed must be auto, 10, 100, 1000, 2500, or 10000" +commit:expression: exec "if [ x$VAR(@) != xauto ]; then \ + if [ x$VAR(../duplex/@) == xauto ]; then \ exit 1; \ fi; \ else \ - if [ x$(../duplex/@) != xauto ]; then \ + if [ x$VAR(../duplex/@) != xauto ]; then \ exit 1; \ fi; \ fi;"; "if speed is hardcoded, duplex must also be hardcoded" -update: "if [ x$(@) != xauto ]; then \ - sudo ethtool -s $(../@) speed $(@) duplex $(../duplex/@) autoneg off; \ +update:expression: "if [ x$VAR(@) != xauto ]; then \ + sudo ethtool -s $VAR(../@) speed $VAR(@) duplex $VAR(../duplex/@) autoneg off; \ else \ - sudo ethtool -s $(../@) autoneg on; \ + sudo ethtool -s $VAR(../@) autoneg on; \ fi; " -delete: "sudo ethtool -s $(../@) autoneg on" +delete:expression: "sudo ethtool -s $VAR(../@) autoneg on" diff --git a/templates/interfaces/ethernet/node.tag/vif/node.def b/templates/interfaces/ethernet/node.tag/vif/node.def index b7af406..e8145b1 100644 --- a/templates/interfaces/ethernet/node.tag/vif/node.def +++ b/templates/interfaces/ethernet/node.tag/vif/node.def @@ -1,12 +1,12 @@ tag: type: u32 -help: "VLAN ID" -syntax: $(@) >= 0 && $(@) <= 4095; "VLAN ID must be between 0 and 4095" -create: "sudo modprobe 8021q"; "Error loading 802.1q driver" -create: "sudo vconfig add $(../@) $(@)"; "Error adding VLAN id $(@) to dev $(../@)" -create: "sudo ip link set $(../@).$(@) up"; "Error enabling VLAN id $(@) on dev $(../@)" -update: "\\${vyatta_sbindir}/vyatta-vtysh.pl -c \"configure terminal\" -c \"interface $(../@).$(@)\" \ +help: VLAN ID +syntax:expression: $VAR(@) >= 0 && $VAR(@) <= 4095; "VLAN ID must be between 0 and 4095" +create:expression: "sudo modprobe 8021q"; "Error loading 802.1q driver" +create:expression: "sudo vconfig add $VAR(../@) $VAR(@)"; "Error adding VLAN id $VAR(@) to dev $VAR(../@)" +create:expression: "sudo ip link set $VAR(../@).$VAR(@) up"; "Error enabling VLAN id $VAR(@) on dev $VAR(../@)" +update:expression: "${vyatta_sbindir}/vyatta-vtysh.pl -c \"configure terminal\" -c \"interface $VAR(../@).$VAR(@)\" \ -c \"link-detect\"; " -delete: "sudo vconfig rem $(../@).$(@)"; "Error removing VLAN id $(@) from dev $(../@)" -#comp_help: possible completions: -# <0-4095> Set VLAN ID +delete:expression: "sudo vconfig rem $VAR(../@).$VAR(@)"; "Error removing VLAN id $VAR(@) from dev $VAR(../@)" +comp_help: possible completions: + <0-4095> Set VLAN ID diff --git a/templates/interfaces/ethernet/node.tag/vif/node.tag/address/node.def b/templates/interfaces/ethernet/node.tag/vif/node.tag/address/node.def index ec1d252..6653727 100644 --- a/templates/interfaces/ethernet/node.tag/vif/node.tag/address/node.def +++ b/templates/interfaces/ethernet/node.tag/vif/node.tag/address/node.def @@ -1,9 +1,9 @@ multi: type: txt -help: "Configure an IP address for this interface" -syntax: exec "/opt/vyatta/sbin/vyatta-interfaces.pl --valid-addr $(@) --dev $(../../@).$(../@) "; "Invalid IP address/prefix [$(@)] for interface $(../../@).$(../@)" -create: "sudo /opt/vyatta/sbin/vyatta-interfaces.pl --eth-addr-update $(@) --dev $(../../@).$(../@) "; "Error setting address $(@) on dev $(../../@).$(../@) " -delete: "sudo /opt/vyatta/sbin/vyatta-interfaces.pl --eth-addr-delete $(@) --dev $(../../@).$(../@) "; "Error deleting address $(@) on dev $(../../@).$(../@) " -#comp_help:Possible completions: -# <IP address>/<prefix length> Set the IP address and prefix length -# dhcp Set the IP address and prefix length via DHCP +help: Configure an IP address for this interface +syntax:expression: exec "/opt/vyatta/sbin/vyatta-interfaces.pl --valid-addr $VAR(@) --dev $VAR(../../@).$VAR(../@) "; "Invalid IP address/prefix [$VAR(@)] for interface $VAR(../../@).$VAR(../@)" +create:expression: "sudo /opt/vyatta/sbin/vyatta-interfaces.pl --eth-addr-update $VAR(@) --dev $VAR(../../@).$VAR(../@) "; "Error setting address $VAR(@) on dev $VAR(../../@).$VAR(../@) " +delete:expression: "sudo /opt/vyatta/sbin/vyatta-interfaces.pl --eth-addr-delete $VAR(@) --dev $VAR(../../@).$VAR(../@) "; "Error deleting address $VAR(@) on dev $VAR(../../@).$VAR(../@) " +comp_help:Possible completions: + <IP address>/<prefix length> Set the IP address and prefix length + dhcp Set the IP address and prefix length via DHCP diff --git a/templates/interfaces/ethernet/node.tag/vif/node.tag/description/node.def b/templates/interfaces/ethernet/node.tag/vif/node.tag/description/node.def index d457185..835ad40 100644 --- a/templates/interfaces/ethernet/node.tag/vif/node.tag/description/node.def +++ b/templates/interfaces/ethernet/node.tag/vif/node.tag/description/node.def @@ -1,2 +1,2 @@ type: txt -help: "Description for this interface" +help: Description for this interface diff --git a/templates/interfaces/ethernet/node.tag/vif/node.tag/disable/node.def b/templates/interfaces/ethernet/node.tag/vif/node.tag/disable/node.def index 6bb8d8d..3b2ae45 100644 --- a/templates/interfaces/ethernet/node.tag/vif/node.tag/disable/node.def +++ b/templates/interfaces/ethernet/node.tag/vif/node.tag/disable/node.def @@ -1,3 +1,3 @@ -help: "Disable interface" -update: "sudo ip link set $(../../@).$(../@) down"; "Error disabling dev $(../../@).$(../@)" -delete: "sudo ip link set $(../../@).$(../@) up"; "Error enabling dev $(../../@).$(../@)" +help: Disable interface +update:expression: "sudo ip link set $VAR(../../@).$VAR(../@) down"; "Error disabling dev $VAR(../../@).$VAR(../@)" +delete:expression: "sudo ip link set $VAR(../../@).$VAR(../@) up"; "Error enabling dev $VAR(../../@).$VAR(../@)" diff --git a/templates/interfaces/loopback/node.def b/templates/interfaces/loopback/node.def index abc3203..72888fc 100644 --- a/templates/interfaces/loopback/node.def +++ b/templates/interfaces/loopback/node.def @@ -1,9 +1,9 @@ tag: type: txt -help: "Loopback interface name" -syntax: exec " \ - if [ -z \"`ip addr | grep $(@) `\" ]; then \ - echo loopback interface $(@) doesn\\'t exist on this system ; \ +help: Loopback interface name +syntax:expression: exec " \ + if [ -z \"`ip addr | grep $VAR(@) `\" ]; then \ + echo loopback interface $VAR(@) doesn\\'t exist on this system ; \ exit 1 ; \ fi ; " -update: "sudo ip link set $(@) up" +update:expression: "sudo ip link set $VAR(@) up" diff --git a/templates/interfaces/loopback/node.tag/address/node.def b/templates/interfaces/loopback/node.tag/address/node.def index af19867..410c072 100644 --- a/templates/interfaces/loopback/node.tag/address/node.def +++ b/templates/interfaces/loopback/node.tag/address/node.def @@ -1,10 +1,10 @@ multi: type: txt -help: "Configure an IP address for this interface" -syntax: exec "/opt/vyatta/sbin/vyatta-interfaces.pl --valid-addr $(@) --dev $(../@)"; "Invalid IP address/prefix [$(@)] for interface $(../@)" -update: "sudo /opt/vyatta/sbin/vyatta-interfaces.pl --eth-addr-update $(@) --dev $(../@)"; "Error setting address $(@) on interface $(../@)" -delete: "sudo /opt/vyatta/sbin/vyatta-interfaces.pl --eth-addr-delete $(@) --dev $(../@)"; "Error deleting address $(@) on interface $(../@)" -#comp_help:Possible completions: -# <IP address>/<prefix length>\tSet the IP address and prefix length -# dhcp\t\t\t\tSet the IP address and prefix length via DHCP +help: Configure an IP address for this interface +syntax:expression: exec "/opt/vyatta/sbin/vyatta-interfaces.pl --valid-addr $VAR(@) --dev $VAR(../@)"; "Invalid IP address/prefix [$VAR(@)] for interface $VAR(../@)" +update:expression: "sudo /opt/vyatta/sbin/vyatta-interfaces.pl --eth-addr-update $VAR(@) --dev $VAR(../@)"; "Error setting address $VAR(@) on interface $VAR(../@)" +delete:expression: "sudo /opt/vyatta/sbin/vyatta-interfaces.pl --eth-addr-delete $VAR(@) --dev $VAR(../@)"; "Error deleting address $VAR(@) on interface $VAR(../@)" +comp_help:Possible completions: + <IP address>/<prefix length>\tSet the IP address and prefix length + dhcp\t\t\t\tSet the IP address and prefix length via DHCP diff --git a/templates/interfaces/loopback/node.tag/description/node.def b/templates/interfaces/loopback/node.tag/description/node.def index d457185..835ad40 100644 --- a/templates/interfaces/loopback/node.tag/description/node.def +++ b/templates/interfaces/loopback/node.tag/description/node.def @@ -1,2 +1,2 @@ type: txt -help: "Description for this interface" +help: Description for this interface diff --git a/templates/interfaces/node.def b/templates/interfaces/node.def index 297604a..7ab9990 100644 --- a/templates/interfaces/node.def +++ b/templates/interfaces/node.def @@ -1 +1 @@ -help: "Network interface configuration" +help: Network interface configuration |