summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMohit Mehta <mohit.mehta@vyatta.com>2009-01-06 11:24:04 -0800
committerMohit Mehta <mohit.mehta@vyatta.com>2009-01-06 11:24:04 -0800
commit7826986414a6b5b2597ed0e39ad4c1975900115e (patch)
treef6e890dae6d96c73dbe0cf4891dce65cc5d70ad6
parent4013dd4c050b61ef2ca0307d8fc68c374db94dc6 (diff)
downloadvyatta-cfg-system-7826986414a6b5b2597ed0e39ad4c1975900115e.tar.gz
vyatta-cfg-system-7826986414a6b5b2597ed0e39ad4c1975900115e.zip
Fix Bug 4022 dynamic dns config fails during system boot if interface does not exist
- Generate a warning rather than a commit fail when user enters a non-existent interface
-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; "