From 0e7996181ab0c46d05ec2bb564ee60815338d978 Mon Sep 17 00:00:00 2001 From: Vincent Riquer Date: Wed, 24 Dec 2014 11:26:24 +0100 Subject: [PATCH] Don't expect scripts to be in working directory --- analyze.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/analyze.py b/analyze.py index 07546ac..a8b2a18 100755 --- a/analyze.py +++ b/analyze.py @@ -456,6 +456,8 @@ def main(): help='use nagios-conformant exit codes') args = parser.parse_args() + mypath = os.path.dirname(os.path.realpath(sys.argv[0])) + if args.debug: logging.basicConfig(stream=sys.stderr, level=logging.DEBUG) else: @@ -473,9 +475,9 @@ def main(): logging.debug('Invoking cipherscan with target: ' + args.target) data='' if args.openssl: - data = subprocess.check_output(['./cipherscan', '-o', args.openssl, '-j', args.target]) + data = subprocess.check_output([mypath + '/cipherscan', '-o', args.openssl, '-j', args.target]) else: - data = subprocess.check_output(['./cipherscan', '-j', args.target]) + data = subprocess.check_output([mypath + '/cipherscan', '-j', args.target]) exit_status=process_results(data, args.level, args.json, args.nagios) else: if os.fstat(args.infile.fileno()).st_size < 2: