[enh] adds a tunnel generator and a null output
This commit is contained in:
parent
9df9d66557
commit
e3361e9482
2 changed files with 157 additions and 0 deletions
46
clitools/exports/toNull.py
Executable file
46
clitools/exports/toNull.py
Executable file
|
|
@ -0,0 +1,46 @@
|
|||
#!/usr/bin/python3
|
||||
# -*- coding: utf-8 -*-
|
||||
# -*- mode: Python -*-
|
||||
|
||||
|
||||
'''
|
||||
|
||||
The exporter that drops all traffic !
|
||||
v0.1.0
|
||||
|
||||
A basic exporter
|
||||
|
||||
LICENCE : CC
|
||||
|
||||
by cocoa
|
||||
|
||||
|
||||
'''
|
||||
from __future__ import print_function
|
||||
import sys
|
||||
import os
|
||||
import argparse
|
||||
import redis
|
||||
import time
|
||||
|
||||
argsparser = argparse.ArgumentParser(description="Null exporter LJ")
|
||||
argsparser.add_argument("-v","--verbose",action="store_true",help="Verbose")
|
||||
args = argsparser.parse_args()
|
||||
|
||||
verbose=args.verbose
|
||||
|
||||
name = "exports::toNull"
|
||||
def debug(*args, **kwargs):
|
||||
if( verbose == False ):
|
||||
return
|
||||
print(*args, file=sys.stderr, **kwargs)
|
||||
|
||||
try:
|
||||
while True:
|
||||
line = sys.stdin.readline()
|
||||
if line == "":
|
||||
time.sleep(0.01)
|
||||
debug(name,"dumping: "+line)
|
||||
except EOFError:
|
||||
debug("break")# no more information
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue