private static void knownHosts(JSch sch)
{
DirectoryInfo home = FS.userHome();
if (home == null)
return;
var known_hosts = new FileInfo(Path.Combine(home.ToString(), ".ssh/known_hosts"));
try
{
using (var s = new StreamReader(known_hosts.FullName))
{
sch.setKnownHosts(s);
}
}
catch (FileNotFoundException)
{
// Oh well. They don't have a known hosts in home.
}
catch (IOException)
{
// Oh well. They don't have a known hosts in home.
}
}