diff options
author | Himbeer <himbeer@disroot.org> | 2024-08-09 14:23:15 +0200 |
---|---|---|
committer | Himbeer <himbeer@disroot.org> | 2024-08-09 14:23:15 +0200 |
commit | c12933227132b21d2bd08b36ac1b33faf9292c7b (patch) | |
tree | 8ec70d81c011108f4c17bcafee6821a5dcdc3d8e | |
parent | beb794bd74cca8d0415a0de1f557246d207545f0 (diff) |
Immediately run logic once on startup
-rw-r--r-- | src/main.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs index b191538..93c5ba9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -45,6 +45,8 @@ fn main() -> Result<()> { let mut tnl = None; let mut last = None; + logic(&mut tnl, &mut last)?; + let mut signals = Signals::new([SIGUSR1])?; for _ in signals.forever() { logic(&mut tnl, &mut last)?; @@ -55,7 +57,7 @@ fn main() -> Result<()> { fn logic(tnl: &mut Option<IpIp6>, last: &mut Option<(Ipv6Addr, Ipv6Addr)>) -> Result<()> { if !Path::new(rsdsl_pd_config::LOCATION).exists() { - println!("[info] ipv6 down"); + println!("[info] no lease"); *tnl = None; // Delete tunnel. |