2020-02-05 14:16:58 -08: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 10:19:22 -08:00
|
|
|
// with the tailscaled node agent.
|
2021-05-17 08:15:50 -07:00
|
|
|
package main // import "tailscale.com/cmd/tailscaled"
|
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
|
|
|
|
2021-05-17 08:15:50 -07:00
|
|
|
"tailscale.com/cmd/tailscaled/cli"
|
2020-02-05 14:16:58 -08:00
|
|
|
)
|
|
|
|
|
2021-05-17 08:15:50 -07:00
|
|
|
func tailscale_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
|
|
|
}
|
|
|
|
}
|