diff options
author | OpenGnSys Support Team <soporte-og@soleta.eu> | 2024-06-28 15:29:24 +0200 |
---|---|---|
committer | OpenGnSys Support Team <soporte-og@soleta.eu> | 2024-06-28 15:29:24 +0200 |
commit | 23bd5f1a0703ffa1f6593489b1b544d8306bb82f (patch) | |
tree | ae553ea71321896eb5f3c72fb26a64866fb912a7 /src/rest.c | |
parent | 814daceeeeeca7e15043b8f4f60ae803e5dda585 (diff) |
rest: create new shell folder automagically
If folder does not exist, create it.
This makes it easier to transition from existing deployments.
Diffstat (limited to 'src/rest.c')
-rw-r--r-- | src/rest.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -853,8 +853,12 @@ static int og_get_client_scripts(struct list_head *script_list) { struct script_entry *script; struct dirent *dent; + struct stat st; DIR *d; + if (stat(OG_SCRIPT_PATH, &st) < 0 && errno == ENOENT) + mkdir(OG_SCRIPT_PATH, 0755); + d = opendir(OG_SCRIPT_PATH); if (!d) { syslog(LOG_ERR, "Cannot open directory %s (%s:%d)\n", |