10 static char **global_argv;
12 static void netifd_do_restart(struct uloop_timeout *timeout)
14 execvp(global_argv[0], global_argv);
17 static struct uloop_timeout restart_timer = {
18 .cb = netifd_do_restart,
21 void netifd_restart(void)
23 uloop_timeout_set(&restart_timer, 1000);
26 static int usage(const char *progname)
28 fprintf(stderr, "Usage: %s [options]\n"
30 " -s <path>: Path to the ubus socket\n"
36 int main(int argc, char **argv)
38 const char *socket = NULL;
43 while ((ch = getopt(argc, argv, "s:")) != -1) {
49 return usage(argv[0]);
53 if (netifd_ubus_init(NULL) < 0) {
54 fprintf(stderr, "Failed to connect to ubus\n");
58 config_init_interfaces(NULL);