Files
bootrr/helpers/timeout
Dmitry Baryshkov dad8a13e9e helpers/bootrr: move timeout to separate helper
There is no need to have timeout as a function in the bootrr file. Move
it to a separate helper file as we have for the rest of helpers.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
2021-11-01 11:48:12 -05:00

18 lines
194 B
Bash
Executable File

#!/bin/sh
if [ $# -lt 2 ]; then
echo "Usage: $0 <seconds> <command> <args>...."
exit 1
fi
attempts="$1"; shift
cmd="$@"
for i in `seq ${attempts}`
do
$cmd && exit 0
sleep 1
done
exit 1