summaryrefslogtreecommitdiffstats
path: root/remote/lib/run.sh
diff options
context:
space:
mode:
Diffstat (limited to 'remote/lib/run.sh')
-rw-r--r--remote/lib/run.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/remote/lib/run.sh b/remote/lib/run.sh
new file mode 100644
index 0000000..fdd7311
--- /dev/null
+++ b/remote/lib/run.sh
@@ -0,0 +1,13 @@
+function run_ {
+ local output=$(eval source "$@")
+
+ flock -x $0 echo -e "$output"
+}
+
+function run {
+ if [ $parallel -gt 0 ]; then
+ run_ "$@" &
+ else
+ run_ "$@"
+ fi
+}