From 261faaec0eec395cf40ece7d0cdf2a33f4c279b6 Mon Sep 17 00:00:00 2001 From: Oleg Kalachev Date: Fri, 14 May 2021 12:05:23 +0300 Subject: [PATCH] Add waitfile script to wait for a file before starting a node --- clover/launch/mavros.launch | 2 +- clover/src/waitfile | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100755 clover/src/waitfile diff --git a/clover/launch/mavros.launch b/clover/launch/mavros.launch index cb958447..9c255a27 100644 --- a/clover/launch/mavros.launch +++ b/clover/launch/mavros.launch @@ -8,7 +8,7 @@ - + diff --git a/clover/src/waitfile b/clover/src/waitfile new file mode 100755 index 00000000..2052e42e --- /dev/null +++ b/clover/src/waitfile @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +# $ ./waitfile +# wait until appears and then invoke with + +echo "wait for file $1 to ${@:2}" +while [ ! -e "$1" ]; do sleep 1; done; +echo "file $1 appeared, run ${@:2}" +"${@:2}"