diff options
Diffstat (limited to 'cfgdir.c')
-rw-r--r-- | cfgdir.c | 49 |
1 files changed, 49 insertions, 0 deletions
@@ -26,6 +26,15 @@ enum scfg_keys { SCFG_KEY_LOCAL, SCFG_KEY_REMOTE, SCFG_KEY_IDLE_TIMEOUT, + SCFG_KEY_STOP_METHOD, + SCFG_KEY_START_METHOD, + SCFG_KEY_STOP_EXEC, + SCFG_KEY_START_EXEC, + /* + SCFG_KEY_SYSTEMD_SERVICE, + SCFG_KEY_RCON, + SCFG_KEY_RCON_PASSWORD, + */ }; struct cfg_key_value_map scfg_key_map[] = { @@ -54,6 +63,22 @@ struct cfg_key_value_map scfg_key_map[] = { .key_value = SCFG_KEY_IDLE_TIMEOUT, .value_type = CFG_VAL_TYPE_UINT16, }, { + .key_name = "stop_method", + .key_value = SCFG_KEY_STOP_METHOD, + .value_type = CFG_VAL_TYPE_STRING, + }, { + .key_name = "start_method", + .key_value = SCFG_KEY_START_METHOD, + .value_type = CFG_VAL_TYPE_STRING, + }, { + .key_name = "stop_exec", + .key_value = SCFG_KEY_STOP_EXEC, + .value_type = CFG_VAL_TYPE_STRING, + }, { + .key_name = "start_exec", + .key_value = SCFG_KEY_START_EXEC, + .value_type = CFG_VAL_TYPE_STRING, + }, { .key_name = NULL, .key_value = SCFG_KEY_INVALID, .value_type = CFG_VAL_TYPE_INVALID, @@ -126,6 +151,30 @@ scfg_parse(struct cfg *cfg, struct server *scfg) return; break; + case SCFG_KEY_STOP_METHOD: + if (!strcmp(value.str, "exec")) { + if (server_set_stop_method(cfg, scfg, SERVER_STOP_METHOD_EXEC)) + break; + } + return; + + case SCFG_KEY_START_METHOD: + if (!strcmp(value.str, "exec")) { + if (server_set_start_method(cfg, scfg, SERVER_START_METHOD_EXEC)) + break; + } + return; + + case SCFG_KEY_STOP_EXEC: + if (!server_set_stop_exec(cfg, scfg, value.str)) + return; + break; + + case SCFG_KEY_START_EXEC: + if (!server_set_start_exec(cfg, scfg, value.str)) + return; + break; + case SCFG_KEY_INVALID: default: break; |