summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMohit Mehta <mohit.mehta@vyatta.com>2009-01-06 11:22:07 -0800
committerMohit Mehta <mohit.mehta@vyatta.com>2009-01-06 11:22:07 -0800
commit77897e426a293114a1aa830b42cfcd3e860ae860 (patch)
treead1a1d5245ee364ff0b6830bf1b6205aca723dd7
parentfef65a611bc57d4be1cd9458a63f7042f9e496e1 (diff)
downloadvyatta-op-77897e426a293114a1aa830b42cfcd3e860ae860.tar.gz
vyatta-op-77897e426a293114a1aa830b42cfcd3e860ae860.zip
Fix Bug 4022 dynamic dns config fails during system boot if interface does not exist
- add information for non-existent interface to show command
-rw-r--r--scripts/vyatta-op-dynamic-dns.pl9
1 files changed, 7 insertions, 2 deletions
diff --git a/scripts/vyatta-op-dynamic-dns.pl b/scripts/vyatta-op-dynamic-dns.pl
index d1197c2..3d24c38 100644
--- a/scripts/vyatta-op-dynamic-dns.pl
+++ b/scripts/vyatta-op-dynamic-dns.pl
@@ -35,12 +35,15 @@ sub print_ddns_stats {
if (@ddns_interfaces > 0){
foreach my $configuredinterface (@ddns_interfaces) {
+ my $no_interface = `ip addr show dev $configuredinterface 2>/dev/null`;
my $no_ip = `ip addr show dev $configuredinterface 2>/dev/null | grep "inet "`;
my @all_cached_entries = `grep "^atime" $ddclient_cache_dir/ddclient_$configuredinterface.cache 2>/dev/null`;
if (@all_cached_entries > 0) {
foreach my $each_entry (@all_cached_entries) {
print "interface : $configuredinterface";
- if ($no_ip eq ""){
+ if ($no_interface eq ""){
+ print " [ Interface does not exist ]";
+ } elsif ($no_ip eq ""){
print " [ Currently no IP address ]";
}
print "\n";
@@ -63,7 +66,9 @@ sub print_ddns_stats {
}
} else {
print "interface : $configuredinterface";
- if ($no_ip eq ""){
+ if ($no_interface eq ""){
+ print " [ Interface does not exist ]";
+ } elsif ($no_ip eq ""){
print " [ Currently no IP address ]";
} else {
print " \n[ Status will be updated within 60 seconds ]";