Example #1
0
def run(args=sys.argv[1:]):
    options = Options()
    try:
        options.parseOptions(args)
    except Exception as exc:
        print("Error: %s" % exc)
        print(options)
        sys.exit(2)
    config.global_options = dict(options)
    config.set_paths()
    config.read_config_file()

    if options['default-collector']:
        options['bouncer'] = CANONICAL_BOUNCER_ONION

    if options['command'] == "upload" and options['report_file']:
        tor_check()
        return tool.upload(options['report_file'],
                           options['collector'],
                           options['bouncer'])
    elif options['command'] == "upload":
        tor_check()
        return tool.upload_all(options['collector'],
                               options['bouncer'])
    elif options['command'] == "status":
        return tool.status()
    else:
        print(options)
Example #2
0
def run():
    config.read_config_file()
    options = parse_options()
    if options['command'] == "upload" and options['report_file']:
        return tool.upload(options['report_file'],
                           options['collector'],
                           options['bouncer'])
    elif options['command'] == "upload":
        return tool.upload_all(options['collector'],
                               options['bouncer'])
    elif options['command'] == "status":
        return tool.status()
Example #3
0
def run():
    config.read_config_file()
    options = Options()
    try:
        options.parseOptions()
    except Exception as exc:
        print("Error: %s" % exc)
        print(options)
        sys.exit(2)
    if options['command'] == "upload" and options['report_file']:
        tor_check()
        return tool.upload(options['report_file'],
                           options['collector'],
                           options['bouncer'])
    elif options['command'] == "upload":
        tor_check()
        return tool.upload_all(options['collector'],
                               options['bouncer'])
    elif options['command'] == "status":
        return tool.status()
    else:
        print(options)