New config module

This commit is contained in:
Neshura 2023-12-25 16:24:18 +01:00
parent 478dc4dd3a
commit 7efa41a48c
Signed by: Neshura
GPG key ID: B6983AAA6B9A7A6C
2 changed files with 111 additions and 1 deletions

View file

@ -3,6 +3,7 @@ use reqwest::blocking::get;
use serde_derive::{Deserialize, Serialize};
use std::{fs, thread::{sleep}};
use chrono::{Utc, Duration};
mod config;
mod cloudflare;
fn default_key() -> String {
@ -359,7 +360,8 @@ fn main() {
let mut now = Utc::now() - Duration::seconds(59);
let mut current = now;
loop {
let ifaces = config::InterfaceConfig::load().unwrap();
let zone_cfgs= config::ZoneConfig::load().unwrap();
now = Utc::now();
if now >= current + Duration::seconds(60) {
current = now;