add env var SVWAIT

This commit is contained in:
primardj 2024-04-05 22:10:11 +01:00
parent a66357a179
commit 989025fe69

View file

@ -9,14 +9,25 @@ fn main() {
// def env variables. // def env variables.
let svdir_env = env::var("SVDIR"); let svdir_env = env::var("SVDIR");
//let svwait_env = env::var("SVWAIT"); let svwait_env = env::var("SVWAIT");
let svdir_var = match svdir_env { let svdir_var = match svdir_env {
Ok(var) => var, Ok(var) => var,
Err(..) => "/run/runit/service".to_string(), Err(..) => "/run/runit/service".to_string(),
}; };
// TODO: check if directory exists
let svwait_var = match svwait_env {
Ok(env) => match env.parse::<i32>() {
Ok(var) => var,
Err(..) => 7,
},
Err(..) => 7,
};
dbg!(svdir_var); dbg!(svdir_var);
dbg!(svwait_var);
// args // args