From da7bf43385e900121aadbd90f6cb22d05c0cff5c Mon Sep 17 00:00:00 2001 From: default Date: Tue, 4 Oct 2022 09:40:16 +0200 Subject: New function adduser(). --- main.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index 64de82c..18c7c22 100644 --- a/main.c +++ b/main.c @@ -16,6 +16,7 @@ int usage(void) printf("Commands:\n"); printf("\n"); printf("init [{basedir}] Initializes the database\n"); + printf("adduser {basedir} [{uid}] Adds a new user\n"); printf("httpd {basedir} Starts the HTTPD daemon\n"); printf("webfinger {basedir} {user} Queries about a @user@host or actor\n"); printf("queue {basedir} {uid} Processes a user queue\n"); @@ -23,7 +24,6 @@ int usage(void) // printf("check {basedir} [{uid}] Checks the database\n"); // printf("purge {basedir} [{uid}] Purges old data\n"); -// printf("adduser {basedir} [{uid}] Adds a new user\n"); // printf("update {basedir} {uid} Sends a user update to followers\n"); // printf("passwd {basedir} {uid} Sets the password for {uid}\n"); @@ -71,9 +71,7 @@ int main(int argc, char *argv[]) /* ... */ basedir = GET_ARGV(); - initdb(basedir); - - return 0; + return initdb(basedir); } if ((basedir = GET_ARGV()) == NULL) @@ -84,6 +82,14 @@ int main(int argc, char *argv[]) return 1; } + if (strcmp(cmd, "adduser") == 0) { + user = GET_ARGV(); + + return adduser(user); + + return 0; + } + if (strcmp(cmd, "httpd") == 0) { httpd(); return 0; -- cgit v1.2.3