aboutsummaryrefslogtreecommitdiffstats
path: root/coin
diff options
context:
space:
mode:
Diffstat (limited to 'coin')
-rw-r--r--coin/provisioning/common/unix/common.sourced.sh4
1 files changed, 3 insertions, 1 deletions
diff --git a/coin/provisioning/common/unix/common.sourced.sh b/coin/provisioning/common/unix/common.sourced.sh
index 7fb267a6..aca5dd04 100644
--- a/coin/provisioning/common/unix/common.sourced.sh
+++ b/coin/provisioning/common/unix/common.sourced.sh
@@ -65,8 +65,10 @@ fatal () {
fi
}
+# Takes one argument which should be the filename of this script. Returns true
+# if the script is being sourced, false if the script is being executed.
is_script_executed () {
- [ x"$(basename "$0")" = x"$1" ]
+ [ x"$(basename $(echo "$0" | sed s/^-//))" = x"$1" ]
}