mirror of
https://github.com/linux-msm/bootrr.git
synced 2026-02-25 13:12:03 -08:00
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>
18 lines
194 B
Bash
Executable File
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
|