Crash on command error

Crash on command error

diff --git a/sp-tools.sh b/sp-tools.sh
index 97a4faa..e401c20 100755
--- a/sp-tools.sh
+++ b/sp-tools.sh
@@ -4,6 +4,15 @@
 # Don't mess with the variables in this script, instead use the generated config.sh
 # to adjust the configurable variables.
 
+
+set -e
+function On_Error () {
+	printf "Critical error at $(caller): ${BASH_COMMAND}\n"
+	exit 1
+}
+trap On_Error ERR
+
+
 SCRIPT=`readlink -f ${BASH_SOURCE[0]}`
 SCRIPTPATH=`dirname "$SCRIPT"`
 SCRIPTNAME=`basename "$0"`

GitHub
sha: 2effda8e