From d0f157450b7f49ea6a260bdae37a93e36f4546e7 Mon Sep 17 00:00:00 2001 From: Hidden Z Date: Tue, 19 Oct 2010 16:29:20 +0000 Subject: [PATCH] injector: add -s/--supress option With this option messages about already existed hostnames will be supressed. --- injector | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/injector b/injector index d18da6a..cf7deca 100755 --- a/injector +++ b/injector @@ -22,6 +22,8 @@ parser.add_argument('-f', '--file', default=os.environ['HOME'] + '/.i2p/hosts.tx help='hosts.txt for parsing') parser.add_argument('-d', '--description', default='Auto-added from external hosts.txt', help='provide custom description message') +parser.add_argument('-s', '--supress', action='store_true', + help='supress warnings about already existed hostnames') args = parser.parse_args() f = open(args.hostsfile, 'r') @@ -45,7 +47,8 @@ for line in f: # beacuse they will fail anyway. qs = i2phost.objects.filter(name=hostname) if qs.exists(): - print 'Host %s already exists' % hostname + if not args.supress: + print 'Host %s already exists' % hostname else: print 'Adding %s' % hostname host = i2phost(name=hostname, b64hash=base64,