Exemple #1
0
static void catch_sig(int sig)
{
	if (sig == SIGTERM)
	{
		alarmtimer(0, 0);
		remove("/var/run/watchdog.pid");
		exit(0);
	}
	else if (sig == SIGHUP)
	{
		setenv_tz();
		ntpc_timer = -1; // want call now
	}
	else if (sig == SIGUSR1)
	{
		int wd_notify_id = nvram_get_int("wd_notify_id");
		if (wd_notify_id == WD_NOTIFY_ID_WIFI2) {
			update_svc_status_wifi24();
		} else if (wd_notify_id == WD_NOTIFY_ID_WIFI5) {
			update_svc_status_wifi5();
		}
	}
	else if (sig == SIGUSR2)
	{
		nmap_timer = 1;
	}
}
Exemple #2
0
static void
watchdog_on_sigusr1(void)
{
    int wd_notify_id = nvram_get_int("wd_notify_id");
    if (wd_notify_id == WD_NOTIFY_ID_WIFI2) {
        update_svc_status_wifi2();
    } else if (wd_notify_id == WD_NOTIFY_ID_WIFI5) {
        update_svc_status_wifi5();
    }
}
Exemple #3
0
static void 
ez_action_toggle_wifi5(void)
{
	if (get_enabled_radio_wl())
	{
		int i_radio_state = is_radio_on_wl();
		i_radio_state = !i_radio_state;
		
		update_svc_status_wifi5();
		
		logmessage("watchdog", "Perform ez-button toggle %s radio: %s", "5GHz", (i_radio_state) ? "ON" : "OFF");
		
		control_radio_wl(i_radio_state, 1);
	}
}
Exemple #4
0
static void 
ez_action_force_toggle_wifi5(void)
{
	int i_radio_state;

	if (get_enabled_radio_wl())
	{
		i_radio_state = 0;
	}
	else
	{
		i_radio_state = 1;
		update_svc_status_wifi5();
	}
	
	nvram_set_int("wl_radio_x", i_radio_state);
	
	logmessage("watchdog", "Perform ez-button force toggle %s radio: %s", "5GHz", (i_radio_state) ? "ON" : "OFF");
	
	control_radio_wl(i_radio_state, 1);
}
Exemple #5
0
static void
ez_action_change_guest_wifi5(void)
{
#if BOARD_HAS_5G_RADIO
    int i_guest_state;

    if (get_enabled_guest_wl())
    {
        i_guest_state = 0;
    }
    else
    {
        i_guest_state = 1;
        update_svc_status_wifi5();
    }

    nvram_wlan_set_int(1, "guest_enable", i_guest_state);

    logmessage("watchdog", "Perform ez-button %s %s %s", (i_guest_state) ? "enable" : "disable", "5GHz", "AP Guest");

    control_guest_wl(i_guest_state, 1);
#endif
}
Exemple #6
0
static void
ez_action_change_wifi5(void)
{
#if BOARD_HAS_5G_RADIO
    int i_radio_state;

    if (get_enabled_radio_wl())
    {
        i_radio_state = 0;
    }
    else
    {
        i_radio_state = 1;
        update_svc_status_wifi5();
    }

    nvram_wlan_set_int(1, "radio_x", i_radio_state);

    logmessage("watchdog", "Perform ez-button %s %s %s", (i_radio_state) ? "enable" : "disable", "5GHz", "radio");

    restart_wifi_wl(i_radio_state, 0);
#endif
}