|
|
@@ -29,9 +29,18 @@ fn main() -> ResultType<()> {
|
|
29
|
29
|
section.iter().for_each(|(k, v)| std::env::set_var(k, v));
|
|
30
|
30
|
}
|
|
31
|
31
|
}
|
|
|
32
|
+ let mut port = RELAY_PORT;
|
|
|
33
|
+ if let Ok(v) = std::env::var("PORT") {
|
|
|
34
|
+ let v: i32 = v.parse().unwrap_or_default();
|
|
|
35
|
+ if v > 0 {
|
|
|
36
|
+ port = v + 1;
|
|
|
37
|
+ }
|
|
|
38
|
+ }
|
|
32
|
39
|
start(
|
|
33
|
|
- matches.value_of("port").unwrap_or(&RELAY_PORT.to_string()),
|
|
34
|
|
- matches.value_of("key").unwrap_or(""),
|
|
|
40
|
+ matches.value_of("port").unwrap_or(&port.to_string()),
|
|
|
41
|
+ matches
|
|
|
42
|
+ .value_of("key")
|
|
|
43
|
+ .unwrap_or(&std::env::var("KEY").unwrap_or_default()),
|
|
35
|
44
|
)?;
|
|
36
|
45
|
Ok(())
|
|
37
|
46
|
}
|