global_parser.add_argument(
"-c", "--config", metavar="<filename>",
help="configuration file (default: /etc/suricata/update.yaml)")
+ global_parser.add_argument(
+ "--user-agent", metavar="<user-agent>",
+ help="Set custom user-agent string")
+
global_args, rem = global_parser.parse_known_args()
if not rem or rem[0].startswith("-"):
update_parser.add_argument("--no-merge", action="store_true", default=False,
help="Do not merge the rules into a single file")
- update_parser.add_argument("--user-agent", metavar="<user-agent>",
- help="Set custom user-agent string")
update_parser.add_argument("-h", "--help", action="store_true")
logger.debug("This is suricata-update version %s (rev: %s); Python: %s" % (
version, revision, sys.version.replace("\n", "- ")))
+ # Load custom user-agent-string.
+ user_agent = config.get("user-agent")
+ if user_agent:
+ logger.info("Using user-agent: %s.", user_agent)
+ suricata.update.net.set_custom_user_agent(user_agent)
+
if args.subcommand:
if hasattr(args, "func"):
return args.func()
logger.info("Loading %s.", drop_conf_filename)
drop_filters += load_drop_filters(drop_conf_filename)
- # Load custom user-agent-string
- user_agent = config.get("user-agent")
- if user_agent:
- logger.info("Using user-agent: %s.",user_agent)
- suricata.update.net.set_custom_user_agent(user_agent)
-
if os.path.exists("/etc/suricata/suricata.yaml") and \
suricata_path and os.path.exists(suricata_path):
logger.info("Loading /etc/suricata/suricata.yaml")