summaryrefslogtreecommitdiffstats
path: root/lib/remote/run.sh
diff options
context:
space:
mode:
Diffstat (limited to 'lib/remote/run.sh')
-rw-r--r--lib/remote/run.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/remote/run.sh b/lib/remote/run.sh
new file mode 100644
index 0000000..fdd7311
--- /dev/null
+++ b/lib/remote/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
+}