aboutsummaryrefslogtreecommitdiffstats
path: root/script/mailin
diff options
context:
space:
mode:
authorLouise Crow <louise.crow@gmail.com>2015-06-18 18:05:04 +0100
committerLouise Crow <louise.crow@gmail.com>2015-06-23 15:43:55 +0100
commiteed8b64bdbdcc69dc8ea44a9d69af830d6970573 (patch)
tree8302661b65355010ceacbf305b1e11b6bce4e06e /script/mailin
parenta125b0307c659c135c7ffe8b48d79dd702c8b422 (diff)
Use BASH_SOURCE to return the script path.
It is reliable in the case where the script is sourced from another script.
Diffstat (limited to 'script/mailin')
-rwxr-xr-xscript/mailin2
1 files changed, 1 insertions, 1 deletions
diff --git a/script/mailin b/script/mailin
index 65f9d06f2..f6b7d1194 100755
--- a/script/mailin
+++ b/script/mailin
@@ -8,7 +8,7 @@ OUTPUT=$(mktemp -t foi-mailin-output-XXXXXXXX)
# Read the email message from stdin, and write it to the file $INPUT
cat >"$INPUT"
-cd "$(dirname "$0")"/..
+cd "$(dirname "${BASH_SOURCE[0]}")"/..
source commonlib/shlib/deployfns
read_conf config/general