mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-31 04:23:40 +00:00
@@ -69,22 +69,21 @@ pub async fn add(
|
|||||||
drop(wpa_supplicant);
|
drop(wpa_supplicant);
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
tokio::spawn(async move {
|
if let Err(err) = add_procedure(
|
||||||
match add_procedure(
|
&mut ctx.db.handle(),
|
||||||
&mut ctx.db.handle(),
|
ctx.wifi_manager.clone(),
|
||||||
ctx.wifi_manager.clone(),
|
&Ssid(ssid.clone()),
|
||||||
&Ssid(ssid.clone()),
|
&Psk(password.clone()),
|
||||||
&Psk(password.clone()),
|
priority,
|
||||||
priority,
|
)
|
||||||
)
|
.await
|
||||||
.await
|
{
|
||||||
{
|
tracing::error!("Failed to add new WiFi network '{}': {}", ssid, err);
|
||||||
Err(e) => {
|
return Err(Error::new(
|
||||||
tracing::info!("Failed to add new WiFi network '{}': {}", ssid, e);
|
color_eyre::eyre::eyre!("Failed adding {}", ssid),
|
||||||
}
|
ErrorKind::Wifi,
|
||||||
Ok(_) => {}
|
));
|
||||||
}
|
}
|
||||||
});
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -122,20 +121,20 @@ pub async fn connect(#[context] ctx: RpcContext, #[arg] ssid: String) -> Result<
|
|||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
tokio::spawn(async move {
|
|
||||||
match connect_procedure(
|
if let Err(err) = connect_procedure(
|
||||||
&mut ctx.db.handle(),
|
&mut ctx.db.handle(),
|
||||||
ctx.wifi_manager.clone(),
|
ctx.wifi_manager.clone(),
|
||||||
&Ssid(ssid.clone()),
|
&Ssid(ssid.clone()),
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
{
|
{
|
||||||
Err(e) => {
|
tracing::error!("Failed to connect to WiFi network '{}': {}", &ssid, err);
|
||||||
tracing::info!("Failed to connect to WiFi network '{}': {}", &ssid, e);
|
return Err(Error::new(
|
||||||
}
|
color_eyre::eyre::eyre!("Can't connect to {}", ssid),
|
||||||
Ok(_) => {}
|
ErrorKind::Wifi,
|
||||||
}
|
));
|
||||||
});
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user