OSX compatibility
[m6w6/btr] / bin / btrd.in
diff --git a/bin/btrd.in b/bin/btrd.in
new file mode 100755 (executable)
index 0000000..bcb1038
--- /dev/null
@@ -0,0 +1,26 @@
+#!/bin/bash
+
+export BTR_BINDIR=$(dirname $0)/
+export BTR_LIBDIR=$(dirname $0)/../share/btr
+BTR_BANNER="Run btr as background daemon receiving jobs for a repo."
+
+. $BTR_LIBDIR/common.sh
+. $BTR_LIBDIR/btr.sh
+
+btr_parseopts "$@"
+btr_setup
+
+if $BTR_VERBOSE
+then
+       btr_conf_show
+       btr_confirm "Everything setup. Do you want to start the daemon?"
+elif ! $BTR_QUIET
+then
+       echo "Starting the daemon. Control with \`btrc $BTR_BUILD\`"
+else
+       echo "$BUILD"
+fi
+
+@SETSID@ $SHELL -c "$BTR_LIBDIR/btrd.sh &"
+
+# vim: noet