Add ssh key support for nanobsd to preserve the ssh data

This commit is contained in:
Scott Ullrich 2009-06-27 16:54:04 -04:00
parent 0fa9ebb1bf
commit 5c3ccc0dcf

View File

@ -46,6 +46,13 @@
return $size;
}
/* restore ssh data for nanobsd platform */
if($g['platform'] == "nanobsd" and file_exists("/config/ssh/ssh_host_key")) {
if(!file_exists("/etc/ssh/sshd_host_key.pub")) {
cp("/config/ssh/* /etc/ssh/");
}
}
/* if any of these files are 0 bytes then they are corrupted.
* remove them
*/
@ -173,9 +180,11 @@
}
// NanoBSD
if(file_exists("/root/save_sshkeys"))
exec("/root/save_sshkeys");
if($g['platform'] == "nanobsd") {
if(!is_dir("/config/sshd"))
exec("mkdir /config/sshd");
exec("cp /etc/ssh/ssh_host* /config/sshd");
}
conf_mount_ro();
?>