mirror of
https://github.com/netbirdio/netbird.git
synced 2024-11-29 03:23:56 +01:00
49 lines
883 B
Go
49 lines
883 B
Go
package cmd
|
|
|
|
import (
|
|
"github.com/kardianos/service"
|
|
log "github.com/sirupsen/logrus"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
type program struct {
|
|
cmd *cobra.Command
|
|
args []string
|
|
}
|
|
|
|
var logger service.Logger
|
|
|
|
func newSVCConfig() *service.Config {
|
|
return &service.Config{
|
|
Name: "wiretrustee",
|
|
DisplayName: "Wiretrustee",
|
|
Description: "A WireGuard-based mesh network that connects your devices into a single private network.",
|
|
}
|
|
}
|
|
|
|
func newSVC(prg *program, conf *service.Config) (service.Service, error) {
|
|
s, err := service.New(prg, conf)
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
return nil, err
|
|
}
|
|
logger, err = s.Logger(nil)
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
return nil, err
|
|
}
|
|
return s, nil
|
|
}
|
|
|
|
var (
|
|
serviceCmd = &cobra.Command{
|
|
Use: "service",
|
|
Short: "manages wiretrustee service",
|
|
//Run: func(cmd *cobra.Command, args []string) {
|
|
//},
|
|
}
|
|
)
|
|
|
|
func init() {
|
|
}
|