ucentral-client: added the support to remove old public IP file once it is connected successfully to controller

Signed-off-by: Satya-sc <Satya@shasta.cloud>
This commit is contained in:
Satya-sc
2023-04-26 20:39:19 +05:30
committed by John Crispin
parent c500514a53
commit a94e2dfd5c

3
main.c
View File

@@ -10,6 +10,8 @@
#include "ucentral.h"
#define PUBLIC_IP_FILE "/tmp/public_ip"
static int reconnect_timeout;
static int bad_CN;
static struct lws_context *context;
@@ -236,6 +238,7 @@ callback_broker(struct lws *wsi, enum lws_callback_reasons reason,
reconnect_timeout = 1;
set_conn_time();
websocket = wsi;
remove(PUBLIC_IP_FILE);
connect_send();
crashlog_init();
event_backlog();