=== modified file 'mandos-ctl' --- mandos-ctl 2009-01-19 05:56:10 +0000 +++ mandos-ctl 2009-01-19 06:55:59 +0000 @@ -115,31 +115,32 @@ parser.add_option("-a", "--all", action="store_true", help="Print all fields") parser.add_option("-e", "--enable", action="store_true", - help="Enable specified client") + help="Enable client") parser.add_option("-d", "--disable", action="store_true", - help="disable specified client") + help="disable client") parser.add_option("-b", "--bump-timeout", action="store_true", - help="Bump timeout of specified client") + help="Bump timeout for client") parser.add_option("--start-checker", action="store_true", - help="Start checker for specified client") + help="Start checker for client") parser.add_option("--stop-checker", action="store_true", - help="Stop checker for specified client") + help="Stop checker for client") parser.add_option("-V", "--is-valid", action="store_true", - help="Check if specified client is still valid") -parser.add_option("-Q", "--quit", action="store_true", - help="Stops the running mandos server") + help="Check if client is still valid") +parser.add_option("-r", "--remove", action="store_true", + help="Remove client") parser.add_option("-c", "--checker", type="string", - help="Set checker command for specified client") + help="Set checker command for client") parser.add_option("-t", "--timeout", type="string", - help="Set timeout for specified client") + help="Set timeout for client") parser.add_option("-i", "--interval", type="string", - help="Set checker interval for specified client") + help="Set checker interval for client") parser.add_option("-H", "--host", type="string", - help="Set host for specified client") + help="Set host for client") parser.add_option("-s", "--secret", type="string", - help="Set password blob (file) for specified client") + help="Set password blob (file) for client") options, client_names = parser.parse_args() +# Compile list of clients to processed clients=[] for name in client_names: for path, client in mandos_clients.iteritems(): @@ -153,15 +154,18 @@ print >> sys.stderr, "Client not found on server: %r" % name sys.exit(1) -if not clients: +if not clients and mandos_clients.values(): keywords = defaultkeywords if options.all: keywords = ('name', 'enabled', 'timeout', 'last_checked_ok', 'created', 'interval', 'host', 'fingerprint', 'checker_running', 'last_enabled', 'checker') print_clients(mandos_clients.values()) - + +# Process each client in the list by all selected options for client in clients: + if options.remove: + mandos_serv.RemoveClient(client.__dbus_object_path__) if options.enable: client.Enable() if options.disable: