refactored gui, implemented systemd integration, install and uninstall scripts

This commit is contained in:
Josh Ashton
2023-12-08 11:05:56 -07:00
parent 591e147f44
commit 90b01a69e9
8 changed files with 844 additions and 62 deletions
+1 -18
View File
@@ -77,14 +77,6 @@ void daemonize() {
// This is not needed.
if (pid > 0) {
printf("daemonizing succeeded! pid: %d\n", pid);
exit(EXIT_SUCCESS);
}
sid = setsid();
if (sid < 0) {
printf("daemonizing failed! sid: %d\n", sid);
exit(EXIT_FAILURE);
}
if ((chdir("/")) < 0) {
@@ -94,16 +86,7 @@ void daemonize() {
}
int main(int argc, char * argv[]) {
// Check if the argument is --daemonize
if (argc > 1) {
if ((strcmp(argv[1], "--daemonize") == 0) || (strcmp(argv[1], "-d") == 0))
daemonize();
} else {
printf("Usage: %s [--daemonize|-d]\n", argv[0]);
printf("recording data once.\n");
recordData();
exit(EXIT_FAILURE);
}
daemonize();
while (1) {
recordData();