Skip to content

Commit

Permalink
Merge pull request #145 from MainKronos/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
MainKronos authored Aug 31, 2024
2 parents 39fd00c + ebf9113 commit 7f3bb90
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions src/start.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ int start(){
if(!PGID) PGID = "1000";
char* USER_NAME = getenv("USER_NAME");

snprintf(command, sizeof(command), "usermod -o -u %s %s", PUID, USER_NAME);
sprintf(command, "usermod -o -u %s %s", PUID, USER_NAME);
res = system(command);
if(res) return res;

snprintf(command, sizeof(command), "groupmod -o -g %s %s", PGID, USER_NAME);
sprintf(command, "groupmod -o -g %s %s", PGID, USER_NAME);
res = system(command);
if(res) return res;

Expand All @@ -38,26 +38,32 @@ int start(){
pwn->pw_uid, pwn->pw_gid
);

res = system("touch /src/database/settings.json");
strcpy(command, "touch /src/database/settings.json");
res = system(command);
if(res) return res;

res = system("touch /src/database/table.json");
strcpy(command, "touch /src/database/table.json");
res = system(command);
if(res) return res;

res = system("touch /src/database/connections.json");
strcpy(command, "touch /src/database/connections.json");
res = system(command);
if(res) return res;

res = system("touch /src/database/tags.json");
strcpy(command, "touch /src/database/tags.json");
res = system(command);
if(res) return res;

snprintf(command, sizeof(command), "chown %s:%s /src -R", USER_NAME, USER_NAME);
sprintf(command, "chown %s:%s /src -R", USER_NAME, USER_NAME);
res = system(command);
if(res) return res;

res = system("chmod 777 /src -R");
strcpy(command, "chmod 777 /src -R");
res = system(command);
if(res) return res;

res = system("pip3 install --upgrade --no-cache-dir --disable-pip-version-check --quiet animeworld");
strcpy(command, "pip3 install --upgrade --no-cache-dir --disable-pip-version-check --quiet animeworld");
res = system(command);
if(res) return res;

char* tmp; /* buffer */
Expand Down Expand Up @@ -93,4 +99,4 @@ int main(int argc, char *argv[])
exit(EXIT_FAILURE);
}
return 0;
}
}

0 comments on commit 7f3bb90

Please sign in to comment.