From 6c77b7d6740ae2dbc01aacf469e1b3def915f095 Mon Sep 17 00:00:00 2001 From: raul Date: Wed, 12 Jun 2024 08:10:06 +0200 Subject: [PATCH] Check if client is online before sending killswitch --- cmd/httpServer.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/cmd/httpServer.go b/cmd/httpServer.go index a7b6bb8..20fc7a9 100644 --- a/cmd/httpServer.go +++ b/cmd/httpServer.go @@ -80,9 +80,13 @@ func removeClient(c *gin.Context) { if err != nil { return } - client.Instruct(Instructions{ - IsKillswitch: true, - }) + + if client.IsOnline == true { + client.Instruct(Instructions{ + IsKillswitch: true, + }) + } + log.Printf("Removing client %v\n", intClientID) if len(clientList) != 1 { clientList = append(clientList[:intClientID], clientList[intClientID+1:]...)