diff options
author | HimbeerserverDE <himbeerserverde@gmail.com> | 2023-03-19 20:12:39 +0100 |
---|---|---|
committer | HimbeerserverDE <himbeerserverde@gmail.com> | 2023-03-19 20:12:39 +0100 |
commit | fa4aff43ba4f4caed5ce6d271d06c25017a18bc9 (patch) | |
tree | 09b5efe5552c7cc4400202e33a0d926e26057f9a /src | |
parent | 06327728fd8245d10da21bb95afc6f3ce2354fa8 (diff) |
run configure_wan regardless of event
Diffstat (limited to 'src')
-rw-r--r-- | src/main.rs | 13 |
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), })?; |