X-Git-Url: https://iankelling.org/git/?p=distro-setup;a=blobdiff_plain;f=btrbkr2;h=f306d39d9d92072413721a81b01d654fecbe65f8;hp=321948cd65b6b3f9c1ea3688531bf59963253b9d;hb=51c8b40fd2aac71d29dc9298ca65425725ad1edd;hpb=0d347f93336619d663f1f3cdd771b92df390c494 diff --git a/btrbkr2 b/btrbkr2 index 321948c..f306d39 100755 --- a/btrbkr2 +++ b/btrbkr2 @@ -4,14 +4,7 @@ # SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: Apache-2.0 -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 -# alternatively, using https://iankelling.org/git/?p=errhandle;a=tree -# source /path/errhandle/err -# on my machine -source /a/bin/errhandle/err +source /a/bin/bash-bear-trap/bash-bear [[ $EUID == 0 ]] || exec sudo -E "${BASH_SOURCE[0]}" "$@"