mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 17:22:49 +01:00
Try to fix bash trap
This commit is contained in:
@@ -28,13 +28,12 @@ WHATWOULDYOUSAYYAHDOHERE=soup
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
trap 'check_err $? $BASH_LINENO $BASH_COMMAND' EXIT
|
trap 'check_err $? $BASH_LINENO' EXIT
|
||||||
|
|
||||||
check_err() {
|
check_err() {
|
||||||
local exit_code=$1
|
local exit_code=$1
|
||||||
local lineno=$2
|
local lineno=$2
|
||||||
local cmd=$3
|
local err_msg="Unhandled error occured, please check $SOUP_LOG for details."
|
||||||
local err_msg="Unknown error occured, please check $SOUP_LOG for details."
|
|
||||||
|
|
||||||
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: "
|
||||||
@@ -86,7 +85,7 @@ check_err() {
|
|||||||
echo 'No route to host'
|
echo 'No route to host'
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo ''
|
echo 'Unhandled error'
|
||||||
echo "$err_msg"
|
echo "$err_msg"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|||||||
Reference in New Issue
Block a user