campaignd: Implement 'readonly' command, toggles RO mode

This commit is contained in:
Ignacio R. Morelle 2015-04-23 22:19:21 -03:00
parent 7b575ed761
commit 44eef2a76a

View file

@ -293,6 +293,12 @@ void server::run()
if(ctl == "shut_down") {
LOG_CS << "Shut down requested by admin, shutting down...\n";
break;
} else if(ctl == "readonly") {
if(ctl.args_count()) {
cfg_["read_only"] = read_only_ = utils::string_bool(ctl[1], true);
}
LOG_CS << "Read only mode: " << (read_only_ ? "enabled" : "disabled") << '\n';
} else {
LOG_CS << "Unrecognized admin command: " << ctl.full() << '\n';
}