diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-01-08 15:16:37 -0800 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-01-08 15:16:37 -0800 |
commit | 4eb5a97f7a8e57156e4bb69fc3b46175e56dd2cf (patch) | |
tree | d4bdd7a0b5cd39dbef1289b4202183596b94b884 /templates | |
parent | 3405299bbdcb8cffead58fce7d0a3f02b070456e (diff) | |
parent | b979b62de18b6e159de2724c90363fa90b9a5095 (diff) | |
download | vyatta-cfg-system-4eb5a97f7a8e57156e4bb69fc3b46175e56dd2cf.tar.gz vyatta-cfg-system-4eb5a97f7a8e57156e4bb69fc3b46175e56dd2cf.zip |
Merge branch 'jenner' of suva.vyatta.com:/git/vyatta-cfg-system into jenner
Diffstat (limited to 'templates')
-rw-r--r-- | templates/service/dns/dynamic/interface/node.def | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/templates/service/dns/dynamic/interface/node.def b/templates/service/dns/dynamic/interface/node.def index bbf0c310..cf7483bb 100644 --- a/templates/service/dns/dynamic/interface/node.def +++ b/templates/service/dns/dynamic/interface/node.def @@ -1,19 +1,6 @@ tag: help: Set interface to send DDNS updates for type: txt -syntax:expression: exec " - intf_array=($(awk '$1 ~ /:/ { print $1 }' /proc/net/dev)) - intf_array_len=${#intf_array[*]} - i=0 - while [ $i -lt $intf_array_len ]; do - temp=${intf_array[$i]%:*} - if [ \"$temp\" == \"$VAR(@)\" ] ; then - exit 0 - fi - let i++ - done - echo Invalid interface [$VAR(@)] - exit 1 " allowed: local -a array ; array=($(awk '$1 ~ /:/ { print $1 }' /proc/net/dev)); @@ -28,4 +15,16 @@ end:expression: "if [ -f \"/tmp/ddclient_$VAR(@).$PPID\" ]; then \ rm /tmp/ddclient_$VAR(@).$PPID; \ else \ sudo /opt/vyatta/sbin/vyatta-dynamic-dns.pl --update-dynamicdns --interface $VAR(@); \ + # generate a warning if interface does not exist on system + intf_array=($(awk '$1 ~ /:/ { print $1 }' /proc/net/dev)) + intf_array_len=${#intf_array[*]} + i=0 + while [ $i -lt $intf_array_len ]; do + temp=${intf_array[$i]%:*} + if [ \"$temp\" == \"$VAR(@)\" ] ; then + exit 0 + fi + let i++ + done + echo Dynamic DNS warning : interface [$VAR(@)] does not exist on system fi; " |