aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorPatrick Spek <p.spek@tyil.nl>2022-04-15 16:32:43 +0200
committerPatrick Spek <p.spek@tyil.nl>2022-04-15 16:32:43 +0200
commitd8a2f732b300cdbb892e0878fe87dbb7a0ef6d03 (patch)
treed364845506af8f3080c79df9a91bb3e32cc4b4d8 /bin
Initial commit
Diffstat (limited to 'bin')
-rwxr-xr-xbin/bashtard21
1 files changed, 21 insertions, 0 deletions
diff --git a/bin/bashtard b/bin/bashtard
new file mode 100755
index 0000000..70e2a97
--- /dev/null
+++ b/bin/bashtard
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+BASHTARD_NAME="$(basename "$0")"
+BASHTARD_BASEDIR="$(CDPATH="" cd -- "$(dirname -- "$0")/.." && pwd -P)"
+BASHTARD_ETCDIR="/etc/$BASHTARD_NAME"
+
+export BASHTARD_BASEDIR
+export BASHTARD_ETCDIR
+export BASHTARD_NAME
+
+main() {
+ if ! command -v bash > /dev/null
+ then
+ printf "You need bash to run %s utilities\n" "$BASHTARD_NAME" >&2
+ exit 1
+ fi
+
+ exec bash "$BASHTARD_BASEDIR/lib/main.bash" "$@"
+}
+
+main "$@"