You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
lokinet/daemon/main.cpp

32 lines
482 B
C++

#include <signal.h>
#include <llarp.hpp>
#include <memory>
std::unique_ptr< llarp::Context > ctx;
6 years ago
void
handle_signal(int sig)
6 years ago
{
if(ctx)
ctx->HandleSignal(sig);
6 years ago
}
int
main(int argc, char *argv[])
{
6 years ago
const char *conffname = "daemon.ini";
if(argc > 1)
conffname = argv[1];
ctx.reset(new llarp::Context(std::cout));
signal(SIGINT, handle_signal);
6 years ago
if(!ctx->LoadConfig(conffname))
return 1;
auto exitcode = ctx->Run();
ctx->Close();
return exitcode;
7 years ago
}