mirror of
https://jihulab.com/mr-one/openpilot.git
synced 2026-10-27 21:13:42 +08:00
29123201ea
Apply the commaai/openpilot -> sunnypilot master sync while preserving c3xl-dev customizations: bundled CD210 startup, model mirror fallback, pyserial launch fix, hidden UI controls, vendored tinygrad, and local vehicle changes. Keep the four modeld_v2 warp pkls; skip the 740MB chestnut big-model artifact.
28 lines
515 B
Bash
Executable File
28 lines
515 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
function fail {
|
|
echo "$1" >&2
|
|
exit 1
|
|
}
|
|
|
|
function retry {
|
|
local n=1
|
|
local max=3 # 3 retries before failure
|
|
local delay=5 # delay between retries, 5 seconds
|
|
while true; do
|
|
echo "Running command '$@' with retry, attempt $n/$max"
|
|
"$@" && break || {
|
|
if [[ $n -lt $max ]]; then
|
|
((n++))
|
|
sleep "$delay";
|
|
else
|
|
fail "The command has failed after $n attempts."
|
|
fi
|
|
}
|
|
done
|
|
}
|
|
|
|
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
|
|
retry "$@"
|
|
fi
|