Reset nodedb command

This commit is contained in:
Ben Meadors
2022-09-25 13:46:11 -05:00
parent 262e921a81
commit a74ec12445
2 changed files with 15 additions and 0 deletions

View File

@@ -285,6 +285,10 @@ def onConnected(interface):
closeNow = True
interface.getNode(args.dest).factoryReset()
if args.reset_nodedb:
closeNow = True
interface.getNode(args.dest).resetNodeDb()
if args.sendtext:
closeNow = True
channelIndex = 0
@@ -876,6 +880,9 @@ def initParser():
parser.add_argument(
"--factory-reset", help="Tell the destination node to install the default config", action="store_true")
parser.add_argument(
"--reset-nodedb", help="Tell the destination node clear its list of nodes", action="store_true")
parser.add_argument(
"--reply", help="Reply to received messages",

View File

@@ -482,6 +482,14 @@ class Node:
return self._sendAdmin(p)
def resetNodeDb(self):
"""Tell the node to reset its list of nodes."""
p = admin_pb2.AdminMessage()
p.nodedb_reset = True
logging.info(f"Telling node to reset the NodeDB")
return self._sendAdmin(p)
def _fixupChannels(self):
"""Fixup indexes and add disabled channels as needed"""