1
0
mirror of https://github.com/mail-in-a-box/mailinabox.git synced 2025-06-08 19:00:55 +00:00

moved trap and changed to EXIT, that way we get correct named scripts exits on sourced scripts

This commit is contained in:
Jeff Volkenant 2018-12-04 10:49:16 -08:00
parent d25aa6804f
commit d0fea0b1be
2 changed files with 2 additions and 2 deletions

View File

@ -3,7 +3,7 @@
# -u: exit if we have a variable typo. # -u: exit if we have a variable typo.
# -o pipefail: don't ignore errors in the non-last command in a pipeline # -o pipefail: don't ignore errors in the non-last command in a pipeline
set -euo pipefail set -euo pipefail
trap 'rc=$?; echo "$0: Error on line $LINENO running $BASH_COMMAND which had the following exit code $rc" 1>&2' EXIT
function hide_output { function hide_output {
# This function hides the output of a command unless the command fails # This function hides the output of a command unless the command fails
# and returns a non-zero exit code. # and returns a non-zero exit code.

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# This is the entry point for configuring the system. # This is the entry point for configuring the system.
##################################################### #####################################################
trap 'rc=$?; echo "$0: Error on line $LINENO running $BASH_COMMAND which had the following exit code $rc" 1>&2' ERR
source setup/functions.sh # load our functions source setup/functions.sh # load our functions
# Check system setup: Are we running as root on Ubuntu 18.04 on a # Check system setup: Are we running as root on Ubuntu 18.04 on a