2020-02-05 22:16:58 +00:00
|
|
|
// Copyright (c) 2020 Tailscale Inc & AUTHORS All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
// The tailscale command is the Tailscale command-line client. It interacts
|
2020-02-14 18:19:22 +00:00
|
|
|
// with the tailscaled node agent.
|
2020-02-10 21:32:16 +00:00
|
|
|
package main // import "tailscale.com/cmd/tailscale"
|
2020-02-05 22:16:58 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"os"
|
2021-03-25 15:21:31 +00:00
|
|
|
"path/filepath"
|
|
|
|
"strings"
|
2020-02-05 22:16:58 +00:00
|
|
|
|
2020-07-15 14:56:48 +00:00
|
|
|
"tailscale.com/cmd/tailscale/cli"
|
2020-02-05 22:16:58 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
2021-03-25 15:21:31 +00: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 14:56:48 +00:00
|
|
|
fmt.Fprintln(os.Stderr, err)
|
|
|
|
os.Exit(1)
|
2020-03-27 20:26:35 +00:00
|
|
|
}
|
|
|
|
}
|