From e7e61db66fe2a596b131a37d2e0b640450bc5195 Mon Sep 17 00:00:00 2001 From: DarkCaster Date: Wed, 10 Jan 2018 04:33:17 +0300 Subject: [PATCH] Add exit code handling from commander, when running selected exec profile --- Sandboxer/includes/run-profile.sh.in | 2 ++ Sandboxer/sandboxer.sh | 2 ++ 2 files changed, 4 insertions(+) diff --git a/Sandboxer/includes/run-profile.sh.in b/Sandboxer/includes/run-profile.sh.in index 09f25ef..b71a4b9 100644 --- a/Sandboxer/includes/run-profile.sh.in +++ b/Sandboxer/includes/run-profile.sh.in @@ -82,9 +82,11 @@ wait_for_cmd_list #run if [[ $exec_bg != true ]]; then "$commander" "$basedir/control" "$channel" "${cfg[sandbox.setup.security_key]}" "${cfg[$exec_profile.start_opcode]}" "$exec_log_out" "$exec_log_err" + exec_code="$?" else &>/dev/null "$commander" "$basedir/control" "$channel" "${cfg[sandbox.setup.security_key]}" "${cfg[$exec_profile.start_opcode]}" "$exec_log_out" "$exec_log_err" & exec_bg_pid="$!" + exec_code="" fi exec_bg="" diff --git a/Sandboxer/sandboxer.sh b/Sandboxer/sandboxer.sh index 09734dd..5c953b2 100755 --- a/Sandboxer/sandboxer.sh +++ b/Sandboxer/sandboxer.sh @@ -291,3 +291,5 @@ log "running exec-profile $profile, using control channel $channel" #start selected exec profile . "$includes_dir/run-profile.sh.in" + +[[ -z $exec_code ]] || exit $exec_code