support makeknowhosts on debian/ubuntu

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.8@15480 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
xq2005 2013-03-13 10:42:14 +00:00
parent a3875d16d1
commit fafee79e70

View File

@ -686,6 +686,16 @@ sub genSSHRootKeys
"Added updates to the $cfgfile file.");
}
}
if ( -e "/etc/debian_version" ){
my $out = `/bin/cat $cfgfile | grep 'HashKnownHosts'`;
if ( $out ){
`/bin/sed -e 's/.*HashKnownHosts.*/HashKnownHosts no/' $cfgfile > tempcfg;mv -f tempcfg $cfgfile`;
}
else{
`/bin/echo HashKnownHosts no >> $cfgfile`;
}
`chmod 600 $cfgfile`;
}
}
else
{
@ -702,6 +712,11 @@ sub genSSHRootKeys
{
xCAT::MsgUtils->message('I', "Added updates to the $cfgfile file.");
}
#debian or ubuntu, the HashKnownHosts default is yes, change it
if ( -e "/etc/debian_version" ){
$cmd = "/bin/echo HashKnownHosts no >> $cfgfile";
xCAT::Utils->runcmd("$cmd", 0);
}
}
#