From 50b75354e03332a64e620317de56ff92a243a89b Mon Sep 17 00:00:00 2001 From: Christian Mehlmauer Date: Tue, 12 May 2015 21:51:15 +0200 Subject: [PATCH] #796, do not swallow exit code --- wpscan.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/wpscan.rb b/wpscan.rb index 7893d97d..1e6f9cd0 100755 --- a/wpscan.rb +++ b/wpscan.rb @@ -2,10 +2,11 @@ # encoding: UTF-8 $: << '.' -require File.dirname(__FILE__) + '/lib/wpscan/wpscan_helper' $exit_code = 0 +require File.dirname(__FILE__) + '/lib/wpscan/wpscan_helper' + def main # delete old logfile, check if it is a symlink first. File.delete(LOG_FILE) if File.exist?(LOG_FILE) and !File.symlink?(LOG_FILE) @@ -412,10 +413,9 @@ def main puts info("Requests Done: #{@total_requests_done}") puts info("Memory used: #{used_memory.bytes_to_human}") puts info("Elapsed time: #{Time.at(elapsed).utc.strftime('%H:%M:%S')}") - exit($exit_code) # must exit! - - rescue SystemExit, Interrupt + rescue Interrupt + # do nothing on interrupt rescue => e puts puts critical(e.message) @@ -434,3 +434,4 @@ def main end main() +exit($exit_code)