1
0
Fork 0
mirror of https://github.com/sileht/bird-lg.git synced 2024-12-22 12:34:42 +01:00

Fix traceroute options for FreeBSD, OpenBSD, NetBSD

This commit is contained in:
Baptiste Jonglez 2014-01-28 16:33:19 +01:00
parent 317de87866
commit e75842b025

View file

@ -20,6 +20,7 @@
###
import sys
import logging
from logging.handlers import TimedRotatingFileHandler
from logging import FileHandler
@ -70,7 +71,13 @@ def traceroute():
query = request.args.get("q","")
query = unquote(query)
command = [ 'traceroute' , o ] + src + [ '-A', '-q1', '-N32', '-w1', '-m15', query ]
if sys.platform.startswith('freebsd') or sys.platform.startswith('netbsd'):
options = [ '-a', '-q1', '-w1', '-m15' ]
if sys.platform.startswith('openbsd'):
options = [ '-A', '-q1', '-w1', '-m15' ]
else: # For Linux
options = [ '-A', '-q1', '-N32', '-w1', '-m15' ]
command = [ 'traceroute' , o ] + src + options + [ query ]
result = subprocess.Popen( command , stdout=subprocess.PIPE).communicate()[0].decode('utf-8', 'ignore').replace("\n","<br>")
return result