Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
SkuldNorniern committed May 2, 2023
2 parents da21bb1 + 9f0726d commit ab0ea5a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/net/interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ pub fn get_interface(device_name: &str) -> Device {
println!("Requested Device : {}", device_name);
let mut selected_device: Device = Device::lookup().unwrap().unwrap();
let devices = Device::list();

let mut is_found = false;
// Begin
match devices {
Ok(vec_devices) => {
Expand All @@ -20,8 +20,13 @@ pub fn get_interface(device_name: &str) -> Device {
"-{} device has been captured! in {:?}",
device_name, duration
);
is_found = true;
};
}
if !is_found {
println!("-{} device not found", device_name);
std::process::exit(1);
}
}
Err(_) => {
println!("No devices found...");
Expand Down

0 comments on commit ab0ea5a

Please sign in to comment.