mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-07 09:42:46 +01:00
Set variable to skip trap if error already handled
This commit is contained in:
@@ -334,6 +334,7 @@ run_check_net_err() {
|
|||||||
exit_code=$?
|
exit_code=$?
|
||||||
|
|
||||||
if [[ $exit_code -ne 0 ]]; then
|
if [[ $exit_code -ne 0 ]]; then
|
||||||
|
ERR_HANDLED=true
|
||||||
echo "Command failed with error $exit_code"
|
echo "Command failed with error $exit_code"
|
||||||
echo "$err_msg"
|
echo "$err_msg"
|
||||||
exit $exit_code
|
exit $exit_code
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ check_err() {
|
|||||||
local lineno=$2
|
local lineno=$2
|
||||||
local err_msg="Unhandled error occured, please check $SOUP_LOG for details."
|
local err_msg="Unhandled error occured, please check $SOUP_LOG for details."
|
||||||
|
|
||||||
|
[[ $ERR_HANDLED == true ]] && exit $exit_code
|
||||||
if [[ $exit_code -ne 0 ]]; then
|
if [[ $exit_code -ne 0 ]]; then
|
||||||
printf '%s' "Soup failed on line $lineno with error $exit_code: "
|
printf '%s' "Soup failed on line $lineno with error $exit_code: "
|
||||||
case $exit_code in
|
case $exit_code in
|
||||||
|
|||||||
Reference in New Issue
Block a user