summaryrefslogtreecommitdiff
path: root/cfgdir.c
diff options
context:
space:
mode:
Diffstat (limited to 'cfgdir.c')
-rw-r--r--cfgdir.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/cfgdir.c b/cfgdir.c
index f961011..9fa0c78 100644
--- a/cfgdir.c
+++ b/cfgdir.c
@@ -32,9 +32,7 @@ enum scfg_keys {
SCFG_KEY_START_EXEC,
SCFG_KEY_RCON,
SCFG_KEY_RCON_PASSWORD,
- /*
SCFG_KEY_SYSTEMD_SERVICE,
- */
};
struct cfg_key_value_map scfg_key_map[] = {
@@ -87,6 +85,10 @@ struct cfg_key_value_map scfg_key_map[] = {
.key_value = SCFG_KEY_RCON_PASSWORD,
.value_type = CFG_VAL_TYPE_STRING,
}, {
+ .key_name = "systemd_service",
+ .key_value = SCFG_KEY_SYSTEMD_SERVICE,
+ .value_type = CFG_VAL_TYPE_STRING,
+ }, {
.key_name = NULL,
.key_value = SCFG_KEY_INVALID,
.value_type = CFG_VAL_TYPE_INVALID,
@@ -166,6 +168,9 @@ scfg_parse(struct cfg *cfg, struct server *scfg)
} else if (!strcmp(value.str, "rcon")) {
if (server_set_stop_method(cfg, scfg, SERVER_STOP_METHOD_RCON))
break;
+ } else if (!strcmp(value.str, "systemd")) {
+ if (server_set_stop_method(cfg, scfg, SERVER_STOP_METHOD_SYSTEMD))
+ break;
}
return;
@@ -173,6 +178,9 @@ scfg_parse(struct cfg *cfg, struct server *scfg)
if (!strcmp(value.str, "exec")) {
if (server_set_start_method(cfg, scfg, SERVER_START_METHOD_EXEC))
break;
+ } else if (!strcmp(value.str, "systemd")) {
+ if (server_set_start_method(cfg, scfg, SERVER_START_METHOD_SYSTEMD))
+ break;
}
return;
@@ -201,6 +209,11 @@ scfg_parse(struct cfg *cfg, struct server *scfg)
return;
break;
+ case SCFG_KEY_SYSTEMD_SERVICE:
+ if (!server_set_systemd_service(cfg, scfg, value.str))
+ return;
+ break;
+
case SCFG_KEY_INVALID:
default:
break;