Skip to content

Commit

Permalink
Add file checks
Browse files Browse the repository at this point in the history
  • Loading branch information
Ragnt committed Feb 10, 2024
1 parent 681a572 commit 7e44088
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,9 @@ impl OxideRuntime {
}
}
Err(e) => {
println!("Error opening file: {}", e);
println!("❌ Error opening target file: {}", e);
println!("❌ Exiting...");
exit(EXIT_FAILURE);
}
}
}
Expand Down Expand Up @@ -451,15 +453,15 @@ impl OxideRuntime {
.filter_map(|f| match MacAddress::from_str(&f) {
Ok(mac) => {
if targ_list.is_actual_target_mac(&mac) {
println!("Whitelist {} is a target. Cannot add to whitelist.", mac);
println!("Whitelist {} is a target. Cannot add to whitelist.", mac);
None
} else {
Some(White::MAC(WhiteMAC::new(mac)))
}
}
Err(_) => {
if targ_list.is_actual_target_ssid(&f) {
println!("Whitelist {} is a target. Cannot add to whitelist.", f);
println!("Whitelist {} is a target. Cannot add to whitelist.", f);
None
} else {
Some(White::SSID(WhiteSSID::new(&f)))
Expand All @@ -485,15 +487,15 @@ impl OxideRuntime {
match MacAddress::from_str(&l) {
Ok(mac) => {
if targ_list.is_actual_target_mac(&mac) {
println!("Whitelist {} is a target. Cannot add to whitelist.", mac);
println!("Whitelist {} is a target. Cannot add to whitelist.", mac);
continue
} else {
White::MAC(WhiteMAC::new(mac))
}
}
Err(_) => {
if targ_list.is_actual_target_ssid(&l) {
println!("Whitelist {} is a target. Cannot add to whitelist.", l);
println!("Whitelist {} is a target. Cannot add to whitelist.", l);
continue
} else {
White::SSID(WhiteSSID::new(&l))
Expand All @@ -509,7 +511,9 @@ impl OxideRuntime {
}
}
Err(e) => {
println!("Error opening file: {}", e);
println!("❌ Error opening whitelist file: {}", e);
println!("❌ Exiting...");
exit(EXIT_FAILURE);
}
}
}
Expand Down

0 comments on commit 7e44088

Please sign in to comment.