summaryrefslogtreecommitdiffstats
path: root/db-functions
diff options
context:
space:
mode:
authorAaron Griffin <aaronmgriffin@gmail.com>2009-01-10 00:13:41 +0100
committerAaron Griffin <aaronmgriffin@gmail.com>2009-01-10 00:13:41 +0100
commit34dc23953ecf218cf263bf150ecb019dee36983d (patch)
treee6edf0386573166f31d12026682a0de5d135005a /db-functions
parentd39b68ede8567fb2ee15f45995ddab8f4710e9dc (diff)
downloaddbscripts-34dc23953ecf218cf263bf150ecb019dee36983d.tar.gz
dbscripts-34dc23953ecf218cf263bf150ecb019dee36983d.tar.xz
Add support for altername BASEDIRs in db-functions
This is needed because we do lots of things via relative paths, and scripts in the misc-scripts dir may need some of these functions too Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
Diffstat (limited to 'db-functions')
-rw-r--r--db-functions5
1 files changed, 4 insertions, 1 deletions
diff --git a/db-functions b/db-functions
index b196d57..a2e2f72 100644
--- a/db-functions
+++ b/db-functions
@@ -3,7 +3,10 @@
# Random integrity things
[ "$UID" = "" ] && UID=$(uid)
-BASEDIR="$(dirname $0)"
+if [ -z "$BASEDIR" ]; then
+ BASEDIR="$(dirname $0)"
+fi
+
if [ -f "$BASEDIR/config" ]; then
. "$BASEDIR/config"
fi