mirror of
https://github.com/adulau/netbeacon.git
synced 2024-11-23 18:47:10 +00:00
-i to set the number of netbeacon to send (Default:10)
This commit is contained in:
parent
d9a9cdf082
commit
2441060500
1 changed files with 6 additions and 1 deletions
|
@ -41,6 +41,7 @@ def nbsend(destination=None,payload=None, logging=False):
|
||||||
usage = "usage: %prog [options] <netbeacon messages>"
|
usage = "usage: %prog [options] <netbeacon messages>"
|
||||||
parser = OptionParser(usage)
|
parser = OptionParser(usage)
|
||||||
parser.add_option("-s","--storeseq", dest="storeseq", action='store_true', help="store sequence and validate sequence")
|
parser.add_option("-s","--storeseq", dest="storeseq", action='store_true', help="store sequence and validate sequence")
|
||||||
|
parser.add_option("-i","--iteration", dest="iteration", type=int, help="set the number of interation for sending the netbeacon")
|
||||||
|
|
||||||
(options, args) = parser.parse_args()
|
(options, args) = parser.parse_args()
|
||||||
|
|
||||||
|
@ -55,9 +56,13 @@ if options.storeseq:
|
||||||
else:
|
else:
|
||||||
seqstart = 1
|
seqstart = 1
|
||||||
|
|
||||||
for x in range(seqstart,seqstart+10):
|
if not options.iteration:
|
||||||
|
options.iteration=10
|
||||||
|
|
||||||
|
for x in range(seqstart,seqstart+options.iteration):
|
||||||
nbsend(destination="127.0.0.1", payload=nbmessage(x), logging=True)
|
nbsend(destination="127.0.0.1", payload=nbmessage(x), logging=True)
|
||||||
if options.storeseq:
|
if options.storeseq:
|
||||||
s['seq'] = x
|
s['seq'] = x
|
||||||
|
|
||||||
if options.storeseq:
|
if options.storeseq:
|
||||||
s.close()
|
s.close()
|
||||||
|
|
Loading…
Reference in a new issue