Skip to content

Commit

Permalink
campaignd: Add 'delete' control FIFO command
Browse files Browse the repository at this point in the history
(cherry-picked from commit 0475c34)
  • Loading branch information
irydacea committed Oct 7, 2018
1 parent ddb0f29 commit 0ddddc5
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/campaign_server/campaign_server.cpp
Expand Up @@ -297,6 +297,15 @@ void server::handle_read_from_fifo(const boost::system::error_code& error, std::
load_config();
LOG_CS << "Reloaded configuration\n";
}
} else if(ctl == "delete") {
if(ctl.args_count() != 1) {
ERR_CS << "Incorrect number of arguments for 'delete'\n";
} else {
const std::string& addon_id = ctl[1];

LOG_CS << "deleting add-on '" << addon_id << "' requested from control FIFO\n";
delete_campaign(addon_id);
}
} else if(ctl == "setpass") {
if(ctl.args_count() != 2) {
ERR_CS << "Incorrect number of arguments for 'setpass'\n";
Expand Down Expand Up @@ -530,6 +539,8 @@ void server::delete_campaign(const std::string& id)
write_config();

fire("hook_post_erase", id);

LOG_CS << "Deleted add-on '" << id << "'\n";
}

#define REGISTER_CAMPAIGND_HANDLER(req_id) \
Expand Down

0 comments on commit 0ddddc5

Please sign in to comment.