diff options
author | Mohit Mehta <mohit.mehta@vyatta.com> | 2009-01-09 18:14:42 -0800 |
---|---|---|
committer | Mohit Mehta <mohit.mehta@vyatta.com> | 2009-01-09 18:14:42 -0800 |
commit | 90b5e004edd75bfaa894f50609ade04aa6d82a8a (patch) | |
tree | bf3317891c222f175332b5fb6c80640a5143dd63 | |
parent | 4b5041588f54689cd7c81e41c2ccd23d2cfa60d0 (diff) | |
download | vyatta-op-90b5e004edd75bfaa894f50609ade04aa6d82a8a.tar.gz vyatta-op-90b5e004edd75bfaa894f50609ade04aa6d82a8a.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.pl | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/scripts/vyatta-op-dynamic-dns.pl b/scripts/vyatta-op-dynamic-dns.pl index 66e7b73..79aa29a 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 ]"; |