summaryrefslogtreecommitdiffstats
path: root/src/fastd.c
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2014-04-11 15:50:43 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2014-04-11 15:50:43 +0200
commita45a313422efa33f261cb1b53a08646a6b3ab947 (patch)
treeabe0d81b6dba97106b1016722e210f02a0168733 /src/fastd.c
parente5a8f900352b242860ac3dd4e3b39c7297169480 (diff)
downloadfastd-a45a313422efa33f261cb1b53a08646a6b3ab947.tar
fastd-a45a313422efa33f261cb1b53a08646a6b3ab947.zip
Improve shell command config handling
Diffstat (limited to 'src/fastd.c')
-rw-r--r--src/fastd.c20
1 files changed, 4 insertions, 16 deletions
diff --git a/src/fastd.c b/src/fastd.c
index 6807ca5..c6fec8b 100644
--- a/src/fastd.c
+++ b/src/fastd.c
@@ -270,31 +270,19 @@ void fastd_handle_receive(fastd_context_t *ctx, fastd_peer_t *peer, fastd_buffer
}
static inline void on_pre_up(fastd_context_t *ctx) {
- if (!ctx->conf->on_pre_up)
- return;
-
- fastd_shell_exec(ctx, ctx->conf->on_pre_up, ctx->conf->on_pre_up_dir, NULL, NULL, NULL, NULL);
+ fastd_shell_command_exec(ctx, &ctx->conf->on_pre_up, NULL, NULL, NULL, NULL);
}
static inline void on_up(fastd_context_t *ctx) {
- if (!ctx->conf->on_up)
- return;
-
- fastd_shell_exec(ctx, ctx->conf->on_up, ctx->conf->on_up_dir, NULL, NULL, NULL, NULL);
+ fastd_shell_command_exec(ctx, &ctx->conf->on_up, NULL, NULL, NULL, NULL);
}
static inline void on_down(fastd_context_t *ctx) {
- if (!ctx->conf->on_down)
- return;
-
- fastd_shell_exec(ctx, ctx->conf->on_down, ctx->conf->on_down_dir, NULL, NULL, NULL, NULL);
+ fastd_shell_command_exec(ctx, &ctx->conf->on_down, NULL, NULL, NULL, NULL);
}
static inline void on_post_down(fastd_context_t *ctx) {
- if (!ctx->conf->on_post_down)
- return;
-
- fastd_shell_exec(ctx, ctx->conf->on_post_down, ctx->conf->on_post_down_dir, NULL, NULL, NULL, NULL);
+ fastd_shell_command_exec(ctx, &ctx->conf->on_post_down, NULL, NULL, NULL, NULL);
}
static fastd_peer_group_t* init_peer_group(const fastd_peer_group_config_t *config, fastd_peer_group_t *parent) {