change the setupSSH routine to only regenerate the ssh keys if they do not exist in roots home directory

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@2602 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
lissav 2009-01-14 15:54:57 +00:00
parent 136b51c305
commit 2cddbeb6de

View File

@ -1080,14 +1080,19 @@ sub setupSSH
mkdir("/install/postscripts/.ssh", 0755);
}
# Generate the keys
# Generate the keys, if they do not already exist
my $rsp={};
xCAT::Utils->runcmd("$::REMOTESHELL_EXPECT -k", 0);
if ($::RUNCMD_RC != 0)
{ # error
$rsp->{data}->[0] = "remoteshell.expect failed generating keys.";
xCAT::MsgUtils->message("E", $rsp, $::CALLBACK);
my $home = xCAT::Utils->getHomeDir("root");
if ( !(-e "$home/.ssh/id_rsa.pub")
|| !(-e "$home/.ssh/id_dsa.pub"))
{
xCAT::Utils->runcmd("$::REMOTESHELL_EXPECT -k", 0);
if ($::RUNCMD_RC != 0)
{ # error
$rsp->{data}->[0] = "remoteshell.expect failed generating keys.";
xCAT::MsgUtils->message("E", $rsp, $::CALLBACK);
}
}
# Copy the keys to the directory