From 4f79058cbdf9370edc294dbe7324d3bc78730169 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0t=C4=9Bp=C3=A1n=20N=C4=9Bmec?= Date: Tue, 3 Oct 2023 17:20:32 +0200 Subject: [PATCH] nvchecker-notify: accept and pass --tries and --failures to nvchecker --- scripts/nvchecker-notify | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scripts/nvchecker-notify b/scripts/nvchecker-notify index dcc8ace..58422ff 100755 --- a/scripts/nvchecker-notify +++ b/scripts/nvchecker-notify @@ -26,6 +26,11 @@ def get_args(): parser.add_argument('-k', '--keyfile', metavar='FILE', type=str, help='use specified keyfile (override the one in configuration file)') + parser.add_argument('-t', '--tries', default=1, type=int, metavar='N', + help='try N times when network errors occur') + parser.add_argument('--failures', action='store_true', + help='exit with code 3 if failures / errors happen during checking') + return parser.parse_args() def main(): @@ -43,6 +48,10 @@ def main(): cmd.extend(['-c', args.file]) if args.keyfile: cmd.extend(['-k', args.keyfile]) + if args.tries: + cmd.extend(['-t', str(args.tries)]) + if args.failures: + cmd.append('--failures') process = subprocess.Popen(cmd, pass_fds=(wfd,)) os.close(wfd)