summaryrefslogtreecommitdiffhomepage
path: root/mullvad-daemon/src/cli.rs
diff options
context:
space:
mode:
authorEmīls Piņķis <emils@mullvad.net>2022-09-13 14:51:20 +0200
committerEmīls Piņķis <emils@mullvad.net>2022-09-13 14:51:20 +0200
commitd0a830effe2b17bad73fc43541eac4c600cbace1 (patch)
tree783bbea4c1a93308d913bbe6c7e3c53acf8338fe /mullvad-daemon/src/cli.rs
parentc5d2534ba7724c2d254f98c295b17a2d91a08f55 (diff)
parent94250f3444422ce2d68aa10c58f77a9d9459a5c4 (diff)
downloadmullvadvpn-d0a830effe2b17bad73fc43541eac4c600cbace1.tar.xz
mullvadvpn-d0a830effe2b17bad73fc43541eac4c600cbace1.zip
Merge branch 'linux-start-daemon-faster'
Diffstat (limited to 'mullvad-daemon/src/cli.rs')
-rw-r--r--mullvad-daemon/src/cli.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/mullvad-daemon/src/cli.rs b/mullvad-daemon/src/cli.rs
index 578bf74dff..e7e332c942 100644
--- a/mullvad-daemon/src/cli.rs
+++ b/mullvad-daemon/src/cli.rs
@@ -10,6 +10,8 @@ pub struct Config {
pub run_as_service: bool,
pub register_service: bool,
pub restart_service: bool,
+ #[cfg(target_os = "linux")]
+ pub initialize_firewall_and_exit: bool,
}
pub fn get_config() -> &'static Config {
@@ -31,11 +33,16 @@ pub fn create_config() -> Config {
let log_to_file = !matches.is_present("disable_log_to_file");
let log_stdout_timestamps = !matches.is_present("disable_stdout_timestamps");
+ #[cfg(target_os = "linux")]
+ let initialize_firewall_and_exit =
+ cfg!(target_os = "linux") && matches.is_present("initialize-early-boot-firewall");
let run_as_service = cfg!(windows) && matches.is_present("run_as_service");
let register_service = cfg!(windows) && matches.is_present("register_service");
let restart_service = cfg!(windows) && matches.is_present("restart_service");
Config {
+ #[cfg(target_os = "linux")]
+ initialize_firewall_and_exit,
log_level,
log_to_file,
log_stdout_timestamps,
@@ -106,5 +113,13 @@ fn create_app() -> App<'static> {
.help("Restarts the existing system service"),
)
}
+
+ if cfg!(target_os = "linux") {
+ app = app.arg(
+ Arg::new("initialize-early-boot-firewall")
+ .long("initialize-early-boot-firewall")
+ .help("Initialize firewall to be used during early boot and exit"),
+ )
+ }
app
}