mirror of
https://github.com/sileht/bird-lg.git
synced 2024-11-25 08:14:42 +01:00
Add support for a configurable whois server
This commit is contained in:
parent
6b7dfbb7a9
commit
ca7eb2b9ac
2
lg.cfg
2
lg.cfg
|
@ -21,4 +21,6 @@ AS_NUMBER = {
|
|||
"h3" : "197422"
|
||||
}
|
||||
|
||||
#WHOIS_SERVER = "whois.foo.bar"
|
||||
|
||||
SESSION_KEY = '\xd77\xf9\xfa\xc2\xb5\xcd\x85)`+H\x9d\xeeW\\%\xbe/\xbaT\x89\xe8\xa7'
|
||||
|
|
5
lg.py
5
lg.py
|
@ -96,7 +96,10 @@ def set_session(request_type, hosts, proto, request_args):
|
|||
|
||||
|
||||
def whois_command(query):
|
||||
return subprocess.Popen(['whois', query], stdout=subprocess.PIPE).communicate()[0].decode('utf-8', 'ignore')
|
||||
server = []
|
||||
if app.config.get("WHOIS_SERVER", ""):
|
||||
server = [ "-h", app.config.get("WHOIS_SERVER") ]
|
||||
return subprocess.Popen(['whois'] + server + [query], stdout=subprocess.PIPE).communicate()[0].decode('utf-8', 'ignore')
|
||||
|
||||
|
||||
def bird_command(host, proto, query):
|
||||
|
|
Loading…
Reference in a new issue