diff options
Diffstat (limited to 'src/rhctl/telnet.go')
-rw-r--r-- | src/rhctl/telnet.go | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/rhctl/telnet.go b/src/rhctl/telnet.go index e4044ef..a6a53fe 100644 --- a/src/rhctl/telnet.go +++ b/src/rhctl/telnet.go @@ -139,8 +139,19 @@ func telnetCmdListen(c *telgo.Client, args []string, ctrl *SwitchControl) bool { } func telnetCmdServer(c *telgo.Client, args []string, ctrl *SwitchControl) bool { - ctrl.Commands <- &Command{Type: CmdServer} - // TODO: implement this + resp := make(chan interface{}) + ctrl.Commands <- &Command{Type: CmdServer, Args: args[1:], Response: resp} + + r := <-resp + switch r.(type) { + case error: + c.Sayln("%v", r) + case bool: + if !r.(bool) { + c.Sayln("the switch-over was denied - is the requested server alive?") + } + } + return false } @@ -200,7 +211,8 @@ func telnetHelp(c *telgo.Client, args []string) bool { return false case "switch": c.Sayln("usage: switch <cmd> [ [ <arg1> ] ... ]") - c.Sayln(" send commands to tha audio switch directley.") + c.Sayln(" send commands to tha audio switch directly.") + // TODO: print help text for raw switch commands return false } fallthrough |