+# put debug options in the local.opts file
+[ -r "$_DATA/local.opts" ] && . "$_DATA/local.opts"
+
+# basic functions
+debug() { #change to false to disable debugging
+ if [ "$DBG_ENABLED" = true -a -n "$*" ]; then
+ echo -E "$*" >>"$DBG_FILE"
+ elif [ "$DBG_ENABLED" = true -a -z "$*" ]; then
+ tee -a "$DBG_FILE"
+ elif [ -z "$*" ]; then
+ cat
+ fi
+}
+
+die() {
+ debug "$*"
+ echo -E "$*" >>/dev/stderr
+ exit 1
+}