From bbeeaee8344bca82f449be645270a5bd00f9c7cf Mon Sep 17 00:00:00 2001 From: "Paul Buetow (lxpbuetow.webde.local)" Date: Mon, 14 Jul 2014 15:37:40 +0200 Subject: add ipv6 support to get curl --- src/fapi | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/fapi b/src/fapi index 1c441bf..8558890 100755 --- a/src/fapi +++ b/src/fapi @@ -491,14 +491,17 @@ class Fapi(FapiBase): if protocol == 'PROTOCOL_TCP': port = str(destination['port']) ip = destination['address'].split('/')[-1] + if re.match('.*:.*', ip): ip = "'[" + ip + "]'" ipport = ip + ':' + port - failtouch = ' || touch ' + ipport + '.failed' headerdump = ' -D ' + ipport + '.header' + redirect = ' >' + ipport + '.out' + ' 2>' + ipport + '.err' + failtouch = ' || touch ' + ipport + '.failed' + postcmd = ipport + redirect + failtouch m = re.match('.*43$', port) if m: - return 'curl -m 3' + headerdump + ' -k https://' + ipport + failtouch + return 'curl -g -m 3' + headerdump + ' -k https://' + postcmd else: - return 'curl -m 3' + headerdump + ' http://' + ipport + failtouch + return 'curl -g -m 3' + headerdump + ' http://' + postcmd else: return '# ' + protocol + ': Can only curl PROTOCOL_TCP. Address: ' + destination['address'] return lambda: curl(f5) -- cgit v1.2.3