diff options
author | Rick Balocca <rbalocca@vyatta.com> | 2008-08-06 15:13:04 -0700 |
---|---|---|
committer | Rick Balocca <rbalocca@vyatta.com> | 2008-08-06 15:13:04 -0700 |
commit | bd9e80da61ecf93bc2e4a7ec649d95cfef89d4e2 (patch) | |
tree | f30552e4c6b0b584f6c2ff81cd38ae539d5612c7 /templates/system/static-host-mapping/host-name/node.def | |
parent | ad73790f163764d737829838e8708a9a9c240151 (diff) | |
parent | b07c0515451f5f429ef10ee2cfc4472ca452a9a9 (diff) | |
download | vyatta-cfg-quagga-bd9e80da61ecf93bc2e4a7ec649d95cfef89d4e2.tar.gz vyatta-cfg-quagga-bd9e80da61ecf93bc2e4a7ec649d95cfef89d4e2.zip |
Merge branch 'islavista' of git:/git/vyatta-cfg-system into islavista
Diffstat (limited to 'templates/system/static-host-mapping/host-name/node.def')
-rw-r--r-- | templates/system/static-host-mapping/host-name/node.def | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/templates/system/static-host-mapping/host-name/node.def b/templates/system/static-host-mapping/host-name/node.def index 189025e3..187b21dd 100644 --- a/templates/system/static-host-mapping/host-name/node.def +++ b/templates/system/static-host-mapping/host-name/node.def @@ -3,9 +3,14 @@ type: txt help: Set to map DNS names to system interfaces syntax:expression: pattern $VAR(@) "^[-a-zA-Z0-9.]+$" ; "invalid host name $VAR(@)" commit:expression: $VAR(./inet) != ""; "IP address for the static mapping must be set" -end:expression: "sudo sh -c \"\ - touch /etc/hosts; \ - sed -i '/ $VAR(@) .*#vyatta entry/d' /etc/hosts; \ - if [ -z \"$VAR(./inet/@)\" ]; then exit 0; fi; \ - declare -a aliases=( $VAR(alias/@@) ); \ - echo \\\"$VAR(inet/@)\t $VAR(@) \\${aliases[*]} \t #vyatta entry\\\" \ >> /etc/hosts\" " +end: sudo sh -c " + touch /etc/hosts + sed -i '/ $VAR(@) .*#vyatta entry/d' /etc/hosts + if [ -z \"$VAR(./inet/@)\" ]; then + if [ -d /opt/vyatta/config/active/service/dns-forwarding ]; then /etc/init.d/dnsmasq restart >&/dev/null; fi + exit 0 + fi + declare -a aliases=( $VAR(alias/@@) ) + echo -e \"$VAR(inet/@)\\t $VAR(@) \${aliases[*]} \\t #vyatta entry\" >> /etc/hosts + if [ -d /opt/vyatta/config/active/service/dns-forwarding ]; then /etc/init.d/dnsmasq restart >&/dev/null; fi" + |