From 2a0b2f4b57c2b6241154ff58fc842f21d1c2e04b Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Wed, 4 Nov 2009 20:07:50 +0000 Subject: print current mode on status request diff --git a/switchctl.c b/switchctl.c index 9bf0612..83ea464 100644 --- a/switchctl.c +++ b/switchctl.c @@ -132,6 +132,12 @@ int process_cmd(const char* cmd, int fd, cmd_t **cmd_q, client_t* client_lst, op if(ret) return ret; + if(cmd_id == STATUS) { + char buf[30]; + snprintf(buf, 30, "Current Mode: %s", opt->mode_ == MODE_MASTER ? "Master" : "Standby"); + send_response(fd, buf); + } + log_printf(NOTICE, "command: %s", cmd); break; } -- cgit v0.10.2