netbird/cmd/root.go
2021-04-15 15:10:39 +02:00

36 lines
511 B
Go

package cmd
import (
"fmt"
"github.com/spf13/cobra"
"os"
"os/signal"
"syscall"
)
var (
rootCmd = &cobra.Command{
Use: "wiretrustee",
Short: "",
Long: "",
}
)
// Execute executes the root command.
func Execute() error {
return rootCmd.Execute()
}
func init() {
rootCmd.AddCommand(upCmd)
rootCmd.AddCommand(signalCmd)
}
func SetupCloseHandler() {
c := make(chan os.Signal)
signal.Notify(c, os.Interrupt, syscall.SIGTERM)
<-c
fmt.Println("\r- Ctrl+C pressed in Terminal")
os.Exit(0)
}