Minor changes.
This commit is contained in:
10
src/main.rs
10
src/main.rs
@@ -3,9 +3,10 @@ extern crate ini;
|
||||
extern crate exitcode;
|
||||
|
||||
use std::env;
|
||||
use std::path::Path;
|
||||
use std::process::Command;
|
||||
use std::thread;
|
||||
use std::time::Duration;
|
||||
use std::process::Command;
|
||||
|
||||
/// Rule description structure
|
||||
pub struct Rule {
|
||||
@@ -161,6 +162,13 @@ fn main() {
|
||||
"/etc/cai-watchdog.conf"
|
||||
};
|
||||
|
||||
if !Path::new(cfg_file).exists() {
|
||||
println!("Error! Can't find configuration file.");
|
||||
println!("Exiting...");
|
||||
|
||||
std::process::exit(exitcode::CONFIG);
|
||||
}
|
||||
|
||||
let cfg = ini!(cfg_file);
|
||||
|
||||
let check_interval = cfg["main"]["check_interval"].clone().unwrap().parse::<u64>().unwrap() * 1000;
|
||||
|
||||
Reference in New Issue
Block a user