mirror of
https://github.com/EFForg/rayhunter.git
synced 2026-05-22 07:44:46 -07:00
Do not print instructions for admin UI when telnet is already running
This commit is contained in:
committed by
Cooper Quintin
parent
95fe938eeb
commit
3dc807fc63
@@ -295,6 +295,16 @@ async fn handler(state: State<AppState>, mut req: Request) -> Result<Response, S
|
||||
}
|
||||
|
||||
async fn tplink_launch_telnet_v5(admin_ip: &str) -> Result<(), Error> {
|
||||
let addr = SocketAddr::from_str(&format!("{admin_ip}:23")).unwrap();
|
||||
|
||||
if telnet_send_command(addr, "true", "exit code 0", true)
|
||||
.await
|
||||
.is_ok()
|
||||
{
|
||||
println!("telnet already appears to be running");
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
let client: HttpProxyClient =
|
||||
hyper_util::client::legacy::Client::<(), ()>::builder(TokioExecutor::new())
|
||||
.build(HttpConnector::new());
|
||||
@@ -316,8 +326,6 @@ async fn tplink_launch_telnet_v5(admin_ip: &str) -> Result<(), Error> {
|
||||
|
||||
let handle = tokio::spawn(async move { axum::serve(listener, app).await });
|
||||
|
||||
let addr = SocketAddr::from_str(&format!("{admin_ip}:23")).unwrap();
|
||||
|
||||
while telnet_send_command(addr, "true", "exit code 0", true)
|
||||
.await
|
||||
.is_err()
|
||||
|
||||
Reference in New Issue
Block a user