X-Git-Url: http://git.openwrt.org/?a=blobdiff_plain;f=main.c;h=5770782f1646498c29be6efd3d45c67be3491f63;hb=41842d3f91733786cb4d2bcdc6ca0c3a1a1c594b;hp=fe97ee1385a54ac1e65427ffbadd0ef15e7a1ffb;hpb=367f5edba8abe7e03890ceb00c00617d64d7bf73;p=project%2Fnetifd.git diff --git a/main.c b/main.c index fe97ee1..5770782 100644 --- a/main.c +++ b/main.c @@ -10,7 +10,9 @@ #include "system.h" #include "interface.h" -const char *main_path = "."; +unsigned int debug_mask = 0; +const char *main_path = DEFAULT_MAIN_PATH; +const char *resolv_conf = DEFAULT_RESOLV_CONF; static char **global_argv; static void netifd_do_restart(struct uloop_timeout *timeout) @@ -42,8 +44,12 @@ static int usage(const char *progname) { fprintf(stderr, "Usage: %s [options]\n" "Options:\n" + " -d : Mask for debug messages\n" " -s : Path to the ubus socket\n" " -p : Path to netifd addons (default: %s)\n" + " -h : Path to the hotplug script\n" + " -r : Path to resolv.conf\n" + " (default: "DEFAULT_HOTPLUG_PATH")\n" "\n", progname, main_path); return 1; @@ -56,14 +62,23 @@ int main(int argc, char **argv) global_argv = argv; - while ((ch = getopt(argc, argv, "s:")) != -1) { + while ((ch = getopt(argc, argv, "d:s:p:h:r:")) != -1) { switch(ch) { + case 'd': + debug_mask = strtoul(optarg, NULL, 0); + break; case 's': socket = optarg; break; case 'p': main_path = optarg; break; + case 'h': + hotplug_cmd_path = optarg; + break; + case 'r': + resolv_conf = optarg; + break; default: return usage(argv[0]); }