netbird/cmd/root.go

36 lines
511 B
Go
Raw Normal View History

package cmd
2021-04-15 15:10:39 +02:00
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)
2021-04-15 15:10:39 +02:00
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)
}