add functions for adding dns servers to the proto list, hook them up in proto-static.c
[project/netifd.git] / main.c
diff --git a/main.c b/main.c
index 465398f..5770782 100644 (file)
--- a/main.c
+++ b/main.c
@@ -11,7 +11,8 @@
 #include "interface.h"
 
 unsigned int debug_mask = 0;
-const char *main_path = ".";
+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)
@@ -46,6 +47,9 @@ static int usage(const char *progname)
                " -d <mask>:            Mask for debug messages\n"
                " -s <path>:            Path to the ubus socket\n"
                " -p <path>:            Path to netifd addons (default: %s)\n"
+               " -h <path>:            Path to the hotplug script\n"
+               " -r <path>:            Path to resolv.conf\n"
+               "                       (default: "DEFAULT_HOTPLUG_PATH")\n"
                "\n", progname, main_path);
 
        return 1;
@@ -58,7 +62,7 @@ int main(int argc, char **argv)
 
        global_argv = argv;
 
-       while ((ch = getopt(argc, argv, "d:s:")) != -1) {
+       while ((ch = getopt(argc, argv, "d:s:p:h:r:")) != -1) {
                switch(ch) {
                case 'd':
                        debug_mask = strtoul(optarg, NULL, 0);
@@ -69,6 +73,12 @@ int main(int argc, char **argv)
                case 'p':
                        main_path = optarg;
                        break;
+               case 'h':
+                       hotplug_cmd_path = optarg;
+                       break;
+               case 'r':
+                       resolv_conf = optarg;
+                       break;
                default:
                        return usage(argv[0]);
                }