From 8b24556fd6927824ad7ce3a3360b7c3cd66943b8 Mon Sep 17 00:00:00 2001 From: "44028017+rkervella@users.noreply.github.com" Date: Wed, 27 Jan 2021 20:24:26 +0100 Subject: [PATCH] Add spinner for execute --- client/command/execute.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/client/command/execute.go b/client/command/execute.go index f23e747b1a..c1b590e828 100644 --- a/client/command/execute.go +++ b/client/command/execute.go @@ -18,7 +18,9 @@ package command import ( "context" "fmt" + "strings" + "github.com/bishopfox/sliver/client/spin" "github.com/bishopfox/sliver/protobuf/rpcpb" "github.com/bishopfox/sliver/protobuf/sliverpb" "github.com/desertbit/grumble" @@ -41,12 +43,17 @@ func execute(ctx *grumble.Context, rpc rpcpb.SliverRPCClient) { args = ctx.Args[1:] } output := ctx.Flags.Bool("silent") + ctrl := make(chan bool) + msg := fmt.Sprintf("Executing %s %s...", cmdPath, strings.Join(args, " ")) + go spin.Until(msg, ctrl) exec, err := rpc.Execute(context.Background(), &sliverpb.ExecuteReq{ Request: ActiveSession.Request(ctx), Path: cmdPath, Args: args, Output: !output, }) + ctrl <- true + <-ctrl if err != nil { fmt.Printf(Warn+"%s", err) } else if !output {