forked from lightninglabs/lightning-terminal
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlit.go
More file actions
37 lines (30 loc) · 647 Bytes
/
Copy pathlit.go
File metadata and controls
37 lines (30 loc) · 647 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package main
import (
"context"
"fmt"
"github.com/lightninglabs/lightning-terminal/litrpc"
"github.com/urfave/cli"
)
var litCommands = []cli.Command{
{
Name: "stop",
Usage: "shutdown the LiT daemon",
Category: "LiT",
Action: shutdownLit,
},
}
func shutdownLit(ctx *cli.Context) error {
clientConn, cleanup, err := connectClient(ctx)
if err != nil {
return err
}
defer cleanup()
client := litrpc.NewLitServiceClient(clientConn)
ctxb := context.Background()
_, err = client.StopDaemon(ctxb, &litrpc.StopDaemonRequest{})
if err != nil {
return err
}
fmt.Println("Successfully shutdown LiTd")
return nil
}