From ca808f5c335a873c87359ce024e1a14ebae706b9 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Fri, 1 Jun 2012 09:50:29 +0200 Subject: initial import: starts and connects to ubus --- main.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 main.c (limited to 'main.c') diff --git a/main.c b/main.c new file mode 100644 index 0000000..e081109 --- /dev/null +++ b/main.c @@ -0,0 +1,37 @@ +#include +#include "procd.h" + +int debug = 0; + +static int usage(const char *prog) +{ + fprintf(stderr, "Usage: %s [options]\n" + "Options:\n" + " -s : Path to ubus socket\n" + " -d: Enable debug messages\n" + "\n", prog); + return 1; +} + +int main(int argc, char **argv) +{ + int ch; + + while ((ch = getopt(argc, argv, "ds:")) != -1) { + switch (ch) { + case 's': + ubus_socket = optarg; + break; + case 'd': + debug++; + break; + default: + return usage(argv[0]); + } + } + uloop_init(); + procd_connect_ubus(); + uloop_run(); + + return 0; +} -- cgit v1.2.3