Check if client is online before sending killswitch

This commit is contained in:
raul 2024-06-12 08:10:06 +02:00
parent d07e6435fb
commit 6c77b7d674
1 changed files with 7 additions and 3 deletions

View File

@ -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:]...)