Skip to content

Commit

Permalink
fix start.c
Browse files Browse the repository at this point in the history
  • Loading branch information
MainKronos committed Aug 31, 2024
1 parent e273ac5 commit 39fd00c
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 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");

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

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

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

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

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

sprintf(command, "chown %s:%s /src -R", USER_NAME, USER_NAME);
res = system(command);
res = system("touch /src/database/connections.json");
if(res) return res;

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

strcpy(command, "pip3 install --upgrade --no-cache-dir --disable-pip-version-check --quiet animeworld");
snprintf(command, sizeof(command), "chown %s:%s /src -R", USER_NAME, USER_NAME);
res = system(command);
if(res) return res;

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

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

char* tmp; /* buffer */
DIR* dir = opendir("/src/script");
if(dir){
Expand Down

0 comments on commit 39fd00c

Please sign in to comment.