aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs
index f70dc7c..b80f70f 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,6 +1,7 @@
use std::fs::File;
use std::io;
use std::net::{Ipv6Addr, SocketAddr};
+use std::path::Path;
use std::thread;
use std::time::Duration;
@@ -54,6 +55,11 @@ fn main() -> Result<()> {
fn logic(tnl: &mut Option<IpIp6>) -> Result<()> {
*tnl = None; // Delete old tunnel.
+ if !Path::new(rsdsl_pd_config::LOCATION).exists() {
+ println!("[info] ipv6 down");
+ return Ok(());
+ }
+
let mut file = File::open(rsdsl_pd_config::LOCATION)?;
let pdconfig: PdConfig = serde_json::from_reader(&mut file)?;