mirror of
https://github.com/netbirdio/netbird.git
synced 2024-11-29 11:33:48 +01:00
36 lines
511 B
Go
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)
|
|
}
|