From 20a07cf8fddeaafe07b8b8366f74e2d4e894e03a Mon Sep 17 00:00:00 2001 From: Jake McGinty Date: Sun, 5 Sep 2021 16:37:58 +0900 Subject: [PATCH] client: don't show Linux instructions outside of linux fixes #128 --- client/src/main.rs | 38 +++++++++++++++++++++++++++++++++----- 1 file changed, 33 insertions(+), 5 deletions(-) diff --git a/client/src/main.rs b/client/src/main.rs index bc67f86..34710aa 100644 --- a/client/src/main.rs +++ b/client/src/main.rs @@ -350,10 +350,6 @@ fn install( {interface} has been {installed}. - It's recommended to now keep the interface automatically refreshing via systemd: - - {systemctl_enable}{interface} - By default, innernet will write to your /etc/hosts file for peer name resolution. To disable this behavior, use the --no-write-hosts or --write-hosts [PATH] options. @@ -365,8 +361,40 @@ fn install( star = "[*]".dimmed(), interface = iface.to_string().yellow(), installed = "installed".green(), - systemctl_enable = "systemctl enable --now innernet@".yellow(), ); + if cfg!(target_os = "linux") { + eprintdoc!( + " + It's recommended to now keep the interface automatically refreshing via systemd: + + {systemctl_enable}{interface} + ", + interface = iface.to_string().yellow(), + systemctl_enable = "systemctl enable --now innernet@".yellow(), + ); + } else if cfg!(target_os = "macos") { + eprintdoc!(" + It's recommended to now keep the interface automatically refreshing, which you can + do via a launchd script (easier macOS helpers to be added to innernet in a later version). + + Ex. to run innernet in a 60s update loop: + + {daemon_mode} {interface} + ", + interface = iface.to_string().yellow(), + daemon_mode = "innernet up -d --interval 60".yellow()); + } else { + eprintdoc!(" + It's recommended to now keep the interface automatically refreshing via whatever service + system your distribution provides. + + Ex. to run innernet in a 60s update loop: + + {daemon_mode} {interface} + ", + interface = iface.to_string().yellow(), + daemon_mode = "innernet up -d --interval 60".yellow()); + } Ok(()) }