diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2021-04-15 23:32:44 -0600 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2021-04-15 23:35:45 -0600 |
commit | 39888214425f5c4d6c3c8344cc0087880de9e663 (patch) | |
tree | 7343a31df63045a01d4d265873cb3c2e67308ec9 | |
parent | c7cd2c9eab6af6c676bcf286af37d729438fceae (diff) |
main: print kernel warning on OpenBSD and FreeBSD too
More kernels!
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-rw-r--r-- | main.go | 29 |
1 files changed, 16 insertions, 13 deletions
@@ -33,25 +33,28 @@ const ( ) func printUsage() { - fmt.Printf("usage:\n") - fmt.Printf("%s [-f/--foreground] INTERFACE-NAME\n", os.Args[0]) + fmt.Printf("Usage: %s [-f/--foreground] INTERFACE-NAME\n", os.Args[0]) } func warning() { - if runtime.GOOS != "linux" || os.Getenv(ENV_WG_PROCESS_FOREGROUND) == "1" { + switch runtime.GOOS { + case "linux", "freebsd", "openbsd": + if os.Getenv(ENV_WG_PROCESS_FOREGROUND) == "1" { + return + } + default: return } - fmt.Fprintln(os.Stderr, "┌───────────────────────────────────────────────────┐") - fmt.Fprintln(os.Stderr, "│ │") - fmt.Fprintln(os.Stderr, "│ Running this software on Linux is unnecessary, │") - fmt.Fprintln(os.Stderr, "│ because the Linux kernel has built-in first │") - fmt.Fprintln(os.Stderr, "│ class support for WireGuard, which will be │") - fmt.Fprintln(os.Stderr, "│ faster, slicker, and better integrated. For │") - fmt.Fprintln(os.Stderr, "│ information on installing the kernel module, │") - fmt.Fprintln(os.Stderr, "│ please visit: <https://wireguard.com/install>. │") - fmt.Fprintln(os.Stderr, "│ │") - fmt.Fprintln(os.Stderr, "└───────────────────────────────────────────────────┘") + fmt.Fprintln(os.Stderr, "┌──────────────────────────────────────────────────────┐") + fmt.Fprintln(os.Stderr, "│ │") + fmt.Fprintln(os.Stderr, "│ Running wireguard-go is not required because this │") + fmt.Fprintln(os.Stderr, "│ kernel has first class support for WireGuard. For │") + fmt.Fprintln(os.Stderr, "│ information on installing the kernel module, │") + fmt.Fprintln(os.Stderr, "│ please visit: │") + fmt.Fprintln(os.Stderr, "│ https://www.wireguard.com/install/ │") + fmt.Fprintln(os.Stderr, "│ │") + fmt.Fprintln(os.Stderr, "└──────────────────────────────────────────────────────┘") } func main() { |