2021-06-19 14:55:45 +02:00
|
|
|
package cmd
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/kardianos/service"
|
2021-06-20 23:01:44 +02:00
|
|
|
log "github.com/sirupsen/logrus"
|
2021-06-19 14:55:45 +02:00
|
|
|
"github.com/spf13/cobra"
|
|
|
|
)
|
|
|
|
|
2021-06-20 23:01:44 +02:00
|
|
|
type program struct {
|
|
|
|
cmd *cobra.Command
|
|
|
|
args []string
|
|
|
|
}
|
|
|
|
|
2021-06-19 14:55:45 +02:00
|
|
|
func newSVCConfig() *service.Config {
|
|
|
|
return &service.Config{
|
|
|
|
Name: "wiretrustee",
|
2021-06-23 01:06:47 +02:00
|
|
|
DisplayName: "Wiretrustee",
|
|
|
|
Description: "A WireGuard-based mesh network that connects your devices into a single private network.",
|
2021-06-19 14:55:45 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-06-20 23:01:44 +02:00
|
|
|
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
|
|
|
|
}
|
|
|
|
return s, nil
|
|
|
|
}
|
|
|
|
|
2021-06-19 14:55:45 +02:00
|
|
|
var (
|
|
|
|
serviceCmd = &cobra.Command{
|
|
|
|
Use: "service",
|
|
|
|
Short: "manages wiretrustee service",
|
|
|
|
}
|
|
|
|
)
|