rest: create new shell folder automagically

If folder does not exist, create it.

This makes it easier to transition from existing deployments.
master
OpenGnSys Support Team 2024-06-28 15:29:24 +02:00
parent 814daceeee
commit 23bd5f1a07
1 changed files with 4 additions and 0 deletions

View File

@ -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",