-source "/etc/bacaprc" 2> /dev/null
-source "/etc/bacap/bacaprc" 2> /dev/null
-source `dirname \`readlink -f "$0"\``/bacaprc 2> /dev/null
-test -n "$1" && source "$1"
-
+load_config() {
+ source "/etc/bacaprc" 2> /dev/null
+ source "/etc/bacap/bacaprc" 2> /dev/null
+ source "$SCRIPT_DIR/bacaprc" 2> /dev/null
+ test -n "$BACAPRC" && source "$BACAPRC"
+}
+load_config