summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2009-01-08 15:16:37 -0800
committerStephen Hemminger <stephen.hemminger@vyatta.com>2009-01-08 15:16:37 -0800
commit4eb5a97f7a8e57156e4bb69fc3b46175e56dd2cf (patch)
treed4bdd7a0b5cd39dbef1289b4202183596b94b884 /templates
parent3405299bbdcb8cffead58fce7d0a3f02b070456e (diff)
parentb979b62de18b6e159de2724c90363fa90b9a5095 (diff)
downloadvyatta-cfg-quagga-4eb5a97f7a8e57156e4bb69fc3b46175e56dd2cf.tar.gz
vyatta-cfg-quagga-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.def25
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; "