2023-01-27 13:37:20 -08:00
|
|
|
// Copyright (c) Tailscale Inc & AUTHORS
|
|
|
|
// SPDX-License-Identifier: BSD-3-Clause
|
2020-02-05 14:16:58 -08:00
|
|
|
|
|
|
|
// The tailscale command is the Tailscale command-line client. It interacts
|
2020-02-14 10:19:22 -08:00
|
|
|
// with the tailscaled node agent.
|
2020-02-10 13:32:16 -08:00
|
|
|
package main // import "tailscale.com/cmd/tailscale"
|
2020-02-05 14:16:58 -08:00
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"os"
|
2021-03-25 08:21:31 -07:00
|
|
|
"path/filepath"
|
|
|
|
"strings"
|
2020-02-05 14:16:58 -08:00
|
|
|
|
2020-07-15 07:56:48 -07:00
|
|
|
"tailscale.com/cmd/tailscale/cli"
|
2020-02-05 14:16:58 -08:00
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
2021-03-25 08:21:31 -07:00
|
|
|
args := os.Args[1:]
|
|
|
|
if name, _ := os.Executable(); strings.HasSuffix(filepath.Base(name), ".cgi") {
|
|
|
|
args = []string{"web", "-cgi"}
|
|
|
|
}
|
|
|
|
if err := cli.Run(args); err != nil {
|
2020-07-15 07:56:48 -07:00
|
|
|
fmt.Fprintln(os.Stderr, err)
|
|
|
|
os.Exit(1)
|
2020-03-27 13:26:35 -07:00
|
|
|
}
|
|
|
|
}
|