add more than one nameservers in /etc/resolv.conf.

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@7637 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
sjing 2010-09-25 09:02:52 +00:00
parent f9f2d20034
commit 28ec23dc21

View File

@ -3961,24 +3961,26 @@ sub mk_resolv_conf_file
my $nameserverstr;
foreach (split /,/, $nameservers)
{
$nameserverstr .= "nameserver $_\n";
}
chomp($nameserverstr);
$cmd = qq~echo $nameserverstr >> $fullname~;
if ($::VERBOSE)
{
my $rsp;
push @{$rsp->{data}}, "Add $nameserverstr into $fullname";
xCAT::MsgUtils->message("I", $rsp, $callback);
}
$output =
xCAT::InstUtils->xcmd($callback, $subreq, "xdsh", $nimprime, $cmd, 0);
if ($::RUNCMD_RC != 0)
{
my $rsp;
push @{$rsp->{data}}, "Could not add nameservers into $fullname";
xCAT::MsgUtils->message("E", $rsp, $callback);
return 1;
$nameserverstr = "nameserver $_";
chomp($nameserverstr);
$cmd = qq~echo $nameserverstr >> $fullname~;
if ($::VERBOSE)
{
my $rsp;
push @{$rsp->{data}}, "Add $nameserverstr into $fullname";
xCAT::MsgUtils->message("I", $rsp, $callback);
}
$output =
xCAT::InstUtils->xcmd($callback, $subreq, "xdsh", $nimprime, $cmd, 0);
if ($::RUNCMD_RC != 0)
{
my $rsp;
push @{$rsp->{data}}, "Could not add nameservers into $fullname";
xCAT::MsgUtils->message("E", $rsp, $callback);
return 1;
}
}
}
else