add failuretrace

This commit is contained in:
Jakobus Schürz 2020-09-21 17:03:48 +02:00
parent 70072fcb65
commit 161834d58c

View file

@ -1,6 +1,14 @@
#!/bin/bash #!/bin/bash
#debug #debug
failure() {
local lineno=$1
local msg=$2
echo "Failed at $lineno: $msg"
}
trap 'failure ${LINENO} "$BASH_COMMAND"' ERR
# set SSHS to false, if not set # set SSHS to false, if not set
if [ -z ${SSHS+x} ]; then export SSHS=false;fi if [ -z ${SSHS+x} ]; then export SSHS=false;fi