summaryrefslogtreecommitdiff
path: root/switchctl.c
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2009-11-04 20:07:50 (GMT)
committerChristian Pointner <equinox@helsinki.at>2009-11-04 20:07:50 (GMT)
commit2a0b2f4b57c2b6241154ff58fc842f21d1c2e04b (patch)
treea3ea0b2c5d4296a19b24b4d7027d02b0d3efc596 /switchctl.c
parent09702cb66d0063b95d8a870a8ce10bc847a80bf6 (diff)
print current mode on status request
Diffstat (limited to 'switchctl.c')
-rw-r--r--switchctl.c6
1 files changed, 6 insertions, 0 deletions
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;
}