summaryrefslogtreecommitdiffstats
path: root/remote/lib/run.sh
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2019-08-25 06:06:41 +0200
committerSuren A. Chilingaryan <csa@suren.me>2019-08-25 06:06:41 +0200
commit16e27beaa24c6c551eaa0d3e6d115017939593a1 (patch)
tree61aea994bfc76e9f0053b26a42406e456c2a962e /remote/lib/run.sh
parentb2d1ca40d5bd1015a37cc243000b636eefc3d128 (diff)
downloadconky-16e27beaa24c6c551eaa0d3e6d115017939593a1.tar.gz
conky-16e27beaa24c6c551eaa0d3e6d115017939593a1.tar.bz2
conky-16e27beaa24c6c551eaa0d3e6d115017939593a1.tar.xz
conky-16e27beaa24c6c551eaa0d3e6d115017939593a1.zip
Support multi-reports
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
+}