This commit is contained in:
Emil 2023-08-04 02:19:55 -06:00
parent c490a1a0bc
commit 8dad78c313
7 changed files with 19 additions and 11 deletions

View File

@ -1,4 +1,2 @@
#!/bin/sh
# Tested to work 100% of the time when that file doesn't exist
# probably
sqlite3 probotic_data.sqlite -init init.sql -line '.quit'

View File

@ -1,4 +0,0 @@
server=irc.rizon.net
username=probotic
port=6667
channel=#stop_shitting_up_chad

8
docs/rizon_default.cfg Normal file
View File

@ -0,0 +1,8 @@
server=irc.rizon.net
username=probotic
port=6667
admins=anon8697 emilemilemil fa11_1eaf
; provide channel yourself
; lines without an equal sign are dropped
; prefix comments with a semicolon for future compat

View File

@ -6,5 +6,7 @@ DECL void rope(void);
DECL char * remind(char * who);
DECL char * raw(char const * const sql);
extern char const * db;
#define API_H_
#endif

View File

@ -6,6 +6,7 @@ typedef struct
char * password;
char * channel;
char * server;
char * admin;
int port;
} creds_t;

View File

@ -21,7 +21,8 @@
} \
} while (0)
static char const * db = DBFILE;
char const * db = DBFILE;
static sqlite3 * connection = NULL;
DECL int

View File

@ -81,15 +81,17 @@ main (int argc,
if (strcmp(arg, "db") == 0)
{ db = argv[1]; }
else if (strcmp(arg, "server") == 0)
{ FREE(creds.server); creds.server = argv[1]; }
{ FREE(creds.server); creds.server = strdup(argv[1]); }
else if (strcmp(arg, "port") == 0)
{ creds.port = atoi(argv[1]); }
else if (strcmp(arg, "channel") == 0)
{ FREE(creds.channel);creds.channel = argv[1]; }
{ FREE(creds.channel); creds.channel = strdup(argv[1]); }
else if (strcmp(arg, "username") == 0)
{ FREE(creds.username); creds.username = argv[1]; }
{ FREE(creds.username); creds.username = strdup(argv[1]); }
else if (strcmp(arg, "password") == 0)
{ FREE(creds.password); creds.password = argv[1]; }
{ FREE(creds.password); creds.password = strdup(argv[1]); }
else if (strcmp(arg, "admin") == 0)
{ FREE(creds.admin); creds.admin = strdup(argv[1]); }
else if (strcmp(arg, "auth") == 0)
{
authfile = argv[1];