mirror of
https://github.com/bol-van/zapret.git
synced 2025-08-10 01:02:03 +03:00
tpws,nfqws: return lists reload on HUP
This commit is contained in:
23
tpws/tpws.c
23
tpws/tpws.c
@@ -50,10 +50,31 @@
|
||||
#define MAX_CONFIG_FILE_SIZE 16384
|
||||
|
||||
struct params_s params;
|
||||
static bool bReload=false;
|
||||
|
||||
static void onhup(int sig)
|
||||
{
|
||||
printf("HUP received !\n");
|
||||
printf("HUP received ! Lists will be reloaded.\n");
|
||||
bReload=true;
|
||||
}
|
||||
void ReloadCheck()
|
||||
{
|
||||
if (bReload)
|
||||
{
|
||||
ResetAllHostlistsModTime();
|
||||
if (!LoadAllHostLists())
|
||||
{
|
||||
DLOG_ERR("hostlists load failed. this is fatal.\n");
|
||||
exit(1);
|
||||
}
|
||||
ResetAllIpsetModTime();
|
||||
if (!LoadAllIpsets())
|
||||
{
|
||||
DLOG_ERR("ipset load failed. this is fatal.\n");
|
||||
exit(1);
|
||||
}
|
||||
bReload=false;
|
||||
}
|
||||
}
|
||||
|
||||
static void onusr2(int sig)
|
||||
|
Reference in New Issue
Block a user