diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2014-04-11 15:50:43 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2014-04-11 15:50:43 +0200 |
commit | a45a313422efa33f261cb1b53a08646a6b3ab947 (patch) | |
tree | abe0d81b6dba97106b1016722e210f02a0168733 /src/config.y | |
parent | e5a8f900352b242860ac3dd4e3b39c7297169480 (diff) | |
download | fastd-a45a313422efa33f261cb1b53a08646a6b3ab947.tar fastd-a45a313422efa33f261cb1b53a08646a6b3ab947.zip |
Improve shell command config handling
Diffstat (limited to 'src/config.y')
-rw-r--r-- | src/config.y | 42 |
1 files changed, 7 insertions, 35 deletions
diff --git a/src/config.y b/src/config.y index e6688d6..70ee4a2 100644 --- a/src/config.y +++ b/src/config.y @@ -374,65 +374,37 @@ secret: TOK_STRING { free(conf->secret); conf->secret = strdup($1->str); } ; on_pre_up: TOK_STRING { - free(conf->on_pre_up); - free(conf->on_pre_up_dir); - - conf->on_pre_up = strdup($1->str); - conf->on_pre_up_dir = get_current_dir_name(); + fastd_shell_command_set(&conf->on_pre_up, $1->str); } ; on_up: TOK_STRING { - free(conf->on_up); - free(conf->on_up_dir); - - conf->on_up = strdup($1->str); - conf->on_up_dir = get_current_dir_name(); + fastd_shell_command_set(&conf->on_up, $1->str); } ; on_down: TOK_STRING { - free(conf->on_down); - free(conf->on_down_dir); - - conf->on_down = strdup($1->str); - conf->on_down_dir = get_current_dir_name(); + fastd_shell_command_set(&conf->on_down, $1->str); } ; on_post_down: TOK_STRING { - free(conf->on_post_down); - free(conf->on_post_down_dir); - - conf->on_post_down = strdup($1->str); - conf->on_post_down_dir = get_current_dir_name(); + fastd_shell_command_set(&conf->on_post_down, $1->str); } ; on_establish: TOK_STRING { - free(conf->on_establish); - free(conf->on_establish_dir); - - conf->on_establish = strdup($1->str); - conf->on_establish_dir = get_current_dir_name(); + fastd_shell_command_set(&conf->on_establish, $1->str); } ; on_disestablish: TOK_STRING { - free(conf->on_disestablish); - free(conf->on_disestablish_dir); - - conf->on_disestablish = strdup($1->str); - conf->on_disestablish_dir = get_current_dir_name(); + fastd_shell_command_set(&conf->on_disestablish, $1->str); } ; on_verify: TOK_STRING { - free(conf->on_verify); - free(conf->on_verify_dir); - - conf->on_verify = strdup($1->str); - conf->on_verify_dir = get_current_dir_name(); + fastd_shell_command_set(&conf->on_verify, $1->str); } ; |