From 23bd5f1a0703ffa1f6593489b1b544d8306bb82f Mon Sep 17 00:00:00 2001 From: OpenGnSys Support Team Date: Fri, 28 Jun 2024 15:29:24 +0200 Subject: rest: create new shell folder automagically If folder does not exist, create it. This makes it easier to transition from existing deployments. --- src/rest.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/rest.c') 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", -- cgit v1.2.3-18-g5258