Skip to content

Commit

Permalink
Added restart command
Browse files Browse the repository at this point in the history
  • Loading branch information
espidev committed May 11, 2018
1 parent 9faf69b commit 041368c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 9 deletions.
Binary file modified cli
Binary file not shown.
29 changes: 20 additions & 9 deletions src/cli/main/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,16 @@ import (

func CommandHelp(input string) {
println("-----Help-----")
println("-h | Get the help interface for flags.")
println("version | Get the version of this instance.")
println("status | Get the status of the instance")
println("instancestop | Stop this instance of EstiConsole.")
println("list | List all of the client servers.")
println("attach [process] | Switch view to another process.")
println("stop [process] | Stop the process using the default stop command.")
println("start [process] | Start the process.")
println("kill [process] | Forcibly kill the process.")
println("-h | Get the help interface for flags.")
println("version | Get the version of this instance.")
println("status | Get the status of the instance")
println("instancestop | Stop this instance of EstiConsole.")
println("list | List all of the client servers.")
println("attach [process] | Switch view to another process.")
println("stop [process] | Stop the process using the default stop command.")
println("start [process] | Start the process.")
println("restart [process] | Restart the process.")
println("kill [process] | Forcibly kill the process.")
}

func CommandVersion(input string) {
Expand Down Expand Up @@ -63,6 +64,16 @@ func CommandStart(input string) {
println(reply.Str)
}

func CommandRestart(input string) {
startCon()
reply, err := client.Stop(context.Background(), &pb.StringRequest{Str: input, AuthToken: token})
checkError(err)
println(reply.Str)
reply, err = client.Start(context.Background(), &pb.StringRequest{Str: input, AuthToken: token})
checkError(err)
println(reply.Str)
}

func CommandKill(input string) {
startCon()
reply, err := client.Kill(context.Background(), &pb.StringRequest{Str: input, AuthToken: token})
Expand Down
1 change: 1 addition & 0 deletions src/cli/main/esticli.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ func init() {
commands["instancestop"] = CommandInstanceStop
commands["stop"] = CommandStop
commands["start"] = CommandStart
commands["restart"] = CommandRestart
commands["kill"] = CommandKill
commands["attach"] = CommandAttach
}
Expand Down

0 comments on commit 041368c

Please sign in to comment.