diff options
author | Rick Balocca <rbalocca@vyatta.com> | 2008-07-18 14:56:45 -0700 |
---|---|---|
committer | Rick Balocca <rbalocca@vyatta.com> | 2008-07-18 14:56:45 -0700 |
commit | 0cea6d439356b0185d6cde838ac01fad1cf18cf0 (patch) | |
tree | 4f9f7def9116c4659f825a7ab0d8ae4bfd6112d1 /scripts | |
parent | f3971ac7bc0989ad4bfb842138be3eee4ac84b17 (diff) | |
parent | 8896340fc868fc6338a7e1ded1a45793aaafd1a8 (diff) | |
download | vyatta-op-0cea6d439356b0185d6cde838ac01fad1cf18cf0.tar.gz vyatta-op-0cea6d439356b0185d6cde838ac01fad1cf18cf0.zip |
Merge branch 'hollywood' into islavista
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/vyatta-show-dhclient.pl | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/scripts/vyatta-show-dhclient.pl b/scripts/vyatta-show-dhclient.pl index a158598..0f3990b 100755 --- a/scripts/vyatta-show-dhclient.pl +++ b/scripts/vyatta-show-dhclient.pl @@ -124,7 +124,20 @@ sub dhclient_show_lease { print "subnet mask: $new_subnet_mask\n" if defined $new_subnet_mask; if (defined $new_domain_name) { print "domain name: $new_domain_name"; - if (`grep domain /etc/resolv.conf 2> /dev/null`) { + my $cli_domain_overrides = 0; + my $if_domain_exists = `grep domain /etc/resolv.conf 2> /dev/null | wc -l`; + if ($if_domain_exists > 0) { + my @domain = `grep domain /etc/resolv.conf`; + for my $each_domain_text_found (@domain) { + my @domain_text_split = split(/\t/, $each_domain_text_found, 2); + my $domain_at_start_of_line = $domain_text_split[0]; + chomp $domain_at_start_of_line; + if ($domain_at_start_of_line eq "domain") { + $cli_domain_overrides = 1; + } + } + } + if ($cli_domain_overrides == 1) { print "\t[overridden by domain-name set using CLI]\n"; } else { print "\n"; |