diff --git a/netclient/command/commands.go b/netclient/command/commands.go index f3251646..ab0014b5 100644 --- a/netclient/command/commands.go +++ b/netclient/command/commands.go @@ -95,6 +95,13 @@ func Leave(cfg config.ClientConfig, force bool) error { } else { ncutils.PrintLog("success", 0) } + nets, err := ncutils.GetSystemNetworks() + if err == nil && len(nets) == 1 { + if nets[0] == cfg.Node.CommID { + ncutils.PrintLog("detected comms as remaining network, removing...", 1) + err = functions.LeaveNetwork(nets[0], true) + } + } return err }