diff options
author | Felix Fietkau <nbd@openwrt.org> | 2011-10-03 03:13:30 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2011-10-03 03:13:30 +0200 |
commit | 367f5edba8abe7e03890ceb00c00617d64d7bf73 (patch) | |
tree | 8d4e80e7985c58743443fdec86b972aad1f43612 /main.c | |
parent | f2d8d143f29d3807532e137813d0b4a0dd2a753c (diff) |
add a ubus call for triggering config reloads
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 18 |
1 files changed, 14 insertions, 4 deletions
@@ -18,14 +18,24 @@ static void netifd_do_restart(struct uloop_timeout *timeout) execvp(global_argv[0], global_argv); } -static struct uloop_timeout restart_timer = { - .cb = netifd_do_restart, -}; +static void netifd_do_reload(struct uloop_timeout *timeout) +{ + config_init_interfaces(NULL); +} + +static struct uloop_timeout main_timer; + +void netifd_reload(void) +{ + main_timer.cb = netifd_do_reload; + uloop_timeout_set(&main_timer, 100); +} void netifd_restart(void) { + main_timer.cb = netifd_do_restart; interface_set_down(NULL); - uloop_timeout_set(&restart_timer, 1000); + uloop_timeout_set(&main_timer, 1000); } static int usage(const char *progname) |