summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOpenGnSys Support Team <soporte-og@soleta.eu>2024-06-28 15:29:24 +0200
committerOpenGnSys Support Team <soporte-og@soleta.eu>2024-06-28 15:29:24 +0200
commit23bd5f1a0703ffa1f6593489b1b544d8306bb82f (patch)
treeae553ea71321896eb5f3c72fb26a64866fb912a7 /src
parent814daceeeeeca7e15043b8f4f60ae803e5dda585 (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')
-rw-r--r--src/rest.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/rest.c b/src/rest.c
index 5e1d468..81c3dd9 100644
--- a/src/rest.c
+++ b/src/rest.c
@@ -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",