X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=fai%2Fconfig%2Ffiles%2Fboot%2Fchboot%2FDEFAULT;h=adfbe1c31d71661d685b64abca31137f6bc0617a;hb=HEAD;hp=6354ed95ecd06f71f118c39f37277b8453d188d9;hpb=61c3a58fcfadab7c333487f887b3f9f3a53bb93a;p=automated-distro-installer diff --git a/fai/config/files/boot/chboot/DEFAULT b/fai/config/files/boot/chboot/DEFAULT index 6354ed9..6b0e964 100755 --- a/fai/config/files/boot/chboot/DEFAULT +++ b/fai/config/files/boot/chboot/DEFAULT @@ -16,21 +16,17 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -[[ $EUID == 0 ]] || exec sudo "$BASH_SOURCE" "$@" +[[ $EUID == 0 ]] || exec sudo -E "${BASH_SOURCE[0]}" "$@" -x="$(readlink -f "$BASH_SOURCE")" -f="${x%/*}/bash-trace" -if [[ -e $f ]]; then - source $f -else - source ${x%/*}/../bash-trace/DEFAULT -fi - +if ! test "$BASH_VERSION"; then echo "error: shell is not bash" >&2; exit 1; fi +shopt -s inherit_errexit 2>/dev/null ||: # ignore fail in bash < 4.4 +set -eE -o pipefail +trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" exit status: $?, PIPESTATUS: ${PIPESTATUS[*]}" >&2' ERR usage() { - cat <