summaryrefslogtreecommitdiffstats
path: root/src/config.c
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2012-03-29 01:28:55 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2012-03-29 01:28:55 +0200
commitaadf0a94b436990202cd2f13f1fe8528a9fd183c (patch)
tree87f5dd658b0503a4c33489e051b6a1b9dd0d85c1 /src/config.c
parent63e123738a9636618421d35ff97a278c06b69703 (diff)
downloadfastd-aadf0a94b436990202cd2f13f1fe8528a9fd183c.tar
fastd-aadf0a94b436990202cd2f13f1fe8528a9fd183c.zip
Implement on-up commands; also fix log print conditions
Diffstat (limited to 'src/config.c')
-rw-r--r--src/config.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/config.c b/src/config.c
index d0d8dbd..b63ade9 100644
--- a/src/config.c
+++ b/src/config.c
@@ -62,6 +62,9 @@ static void default_config(fastd_config *conf) {
conf->protocol = &fastd_protocol_null;
conf->secret = NULL;
conf->peers = NULL;
+
+ conf->on_up = NULL;
+ conf->on_up_dir = NULL;
}
static bool config_match(const char *opt, ...) {
@@ -319,6 +322,16 @@ void fastd_configure(fastd_context *ctx, fastd_config *conf, int argc, char *con
continue;
}
+ IF_OPTION_ARG("--on-up") {
+ free(conf->on_up);
+ free(conf->on_up_dir);
+
+ conf->on_up = strdup(arg);
+ conf->on_up_dir = get_current_dir_name();
+
+ continue;
+ }
+
IF_OPTION("--generate-key") {
keygen = true;
continue;