client: don't show Linux instructions outside of linux

fixes #128
pull/142/head
Jake McGinty 2021-09-05 16:37:58 +09:00
parent b7de9cdc47
commit 20a07cf8fd
1 changed files with 33 additions and 5 deletions

View File

@ -350,10 +350,6 @@ fn install(
{interface} has been {installed}. {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 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] resolution. To disable this behavior, use the --no-write-hosts or --write-hosts [PATH]
options. options.
@ -365,8 +361,40 @@ fn install(
star = "[*]".dimmed(), star = "[*]".dimmed(),
interface = iface.to_string().yellow(), interface = iface.to_string().yellow(),
installed = "installed".green(), 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(()) Ok(())
} }