wip: PXE setup for ipxe and okd files in progress

This commit is contained in:
2025-08-21 17:28:17 -04:00
parent e956772593
commit da6610c625
24 changed files with 1242 additions and 209 deletions

View File

@@ -44,6 +44,11 @@ impl OPNsenseShell for SshOPNSenseShell {
.unwrap()
.as_millis()
);
self.write_content_to_file(content, &temp_filename).await
}
async fn write_content_to_file(&self, content: &str, filename: &str) -> Result<String, Error> {
// TODO fix this to create the directory before uploading the file
let channel = self.get_ssh_channel().await?;
channel
.request_subsystem(true, "sftp")
@@ -53,10 +58,10 @@ impl OPNsenseShell for SshOPNSenseShell {
.await
.expect("Should acquire sftp subsystem");
let mut file = sftp.create(&temp_filename).await.unwrap();
let mut file = sftp.create(filename).await.unwrap();
file.write_all(content.as_bytes()).await?;
Ok(temp_filename)
Ok(filename.to_string())
}
async fn upload_folder(&self, source: &str, destination: &str) -> Result<String, Error> {