This commit is contained in:
@@ -4,7 +4,8 @@ use crate::{
|
||||
config::{SshConfigManager, SshCredentials, SshOPNSenseShell},
|
||||
error::Error,
|
||||
modules::{
|
||||
caddy::CaddyConfig, dhcp_legacy::DhcpConfigLegacyISC, dns::DnsConfig, dnsmasq::DhcpConfigDnsMasq, load_balancer::LoadBalancerConfig, tftp::TftpConfig
|
||||
caddy::CaddyConfig, dhcp_legacy::DhcpConfigLegacyISC, dns::DnsConfig,
|
||||
dnsmasq::DhcpConfigDnsMasq, load_balancer::LoadBalancerConfig, tftp::TftpConfig,
|
||||
},
|
||||
};
|
||||
use log::{debug, info, trace, warn};
|
||||
|
||||
@@ -159,11 +159,7 @@ impl SshOPNSenseShell {
|
||||
wait_for_completion(&mut channel).await
|
||||
}
|
||||
|
||||
async fn ensure_remote_dir_exists(
|
||||
&self,
|
||||
sftp: &SftpSession,
|
||||
path: &str,
|
||||
) -> Result<(), Error> {
|
||||
async fn ensure_remote_dir_exists(&self, sftp: &SftpSession, path: &str) -> Result<(), Error> {
|
||||
if !sftp.try_exists(path).await? {
|
||||
info!("Creating remote directory {path}");
|
||||
sftp.create_dir(path).await?;
|
||||
|
||||
@@ -187,12 +187,10 @@ dhcp-boot=tag:bios,{bios_filename}{tftp_str}
|
||||
})?;
|
||||
|
||||
info!("Restarting dnsmasq to apply changes");
|
||||
self.opnsense_shell.exec("configctl dnsmasq restart").await
|
||||
.map_err(|e| {
|
||||
DhcpError::Configuration(format!(
|
||||
"Restarting dnsmasq failed : {e}"
|
||||
))
|
||||
})?;
|
||||
self.opnsense_shell
|
||||
.exec("configctl dnsmasq restart")
|
||||
.await
|
||||
.map_err(|e| DhcpError::Configuration(format!("Restarting dnsmasq failed : {e}")))?;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
pub mod caddy;
|
||||
pub mod dhcp;
|
||||
pub mod dhcp_legacy;
|
||||
pub mod dns;
|
||||
pub mod dnsmasq;
|
||||
pub mod load_balancer;
|
||||
pub mod tftp;
|
||||
pub mod dhcp;
|
||||
pub mod dnsmasq;
|
||||
|
||||
Reference in New Issue
Block a user