aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main.rs13
1 files changed, 2 insertions, 11 deletions
diff --git a/src/main.rs b/src/main.rs
index c33947e..5614da3 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -7,8 +7,7 @@ use std::path::Path;
use std::thread;
use std::time::Duration;
-use notify::event::{CreateKind, ModifyKind};
-use notify::{Event, EventKind, RecursiveMode, Watcher};
+use notify::{Event, RecursiveMode, Watcher};
use rsdsl_ip_config::IpConfig;
fn main() -> Result<()> {
@@ -16,15 +15,7 @@ fn main() -> Result<()> {
link::up("eth1".into())?;
let mut watcher = notify::recommended_watcher(|res: notify::Result<Event>| match res {
- Ok(event) => match event.kind {
- EventKind::Create(kind) if kind == CreateKind::File => {
- configure_wan();
- }
- EventKind::Modify(kind) if matches!(kind, ModifyKind::Data(_)) => {
- configure_wan();
- }
- _ => {}
- },
+ Ok(_) => configure_wan(),
Err(e) => println!("[netlinkd] watch error: {}", e),
})?;