version 1.146, 2022/01/07 04:22:29 |
version 1.148, 2022/01/11 02:48:11 |
|
|
} |
} |
|
|
usage() { |
usage() { |
echo "usage: ${0##*/} [-d | -D] [-av] [-p path] [driver | file ...]" |
echo "usage: ${0##*/} [-d | -F] [-av] [-p path] [driver | file ...]" |
exit 2 |
exit 2 |
} |
} |
|
|
|
|
for f in "${devices[@]}"; do |
for f in "${devices[@]}"; do |
d="$( firmware_devicename "$f" )" |
d="$( firmware_devicename "$f" )" |
|
|
verify_existing="$DOWNLOAD" |
verify_existing=true |
if [ "$f" = "$d" ]; then |
if [ "$f" = "$d" ]; then |
f=$( firmware_filename "$d" || true ) |
f=$( firmware_filename "$d" || true ) |
[ "$f" ] || continue |
[ "$f" ] || continue |
|
|
done |
done |
fi |
fi |
|
|
if [ -e "$f" ]; then |
if "$verify_existing" && [ -e "$f" ]; then |
if "$DOWNLOAD"; then |
msg="Keep/Verify" |
if "$verify_existing" && ! "$DRYRUN"; then |
"$INSTALL" && msg="Verify" |
[ "$VERBOSE" -gt 1 ] && ! "$INSTALL" && |
[ "$VERBOSE" -gt 1 ] && ! "$INSTALL" && |
echo "Keep/Verify ${f##*/}" |
echo "$msg ${f##*/}" |
verify "$f" || continue |
|
else |
if "$DRYRUN" || verify "$f"; then |
[ "$VERBOSE" -gt 1 ] && ! "$INSTALL" && |
|
echo "Keep ${f##*/}" |
|
fi |
|
"$INSTALL" || kept="$kept,$d" |
"$INSTALL" || kept="$kept,$d" |
# else assume it was verified when downloaded |
elif "$DOWNLOAD"; then |
|
[ "$VERBOSE" -gt 0 ] && echo "Refetching $f" |
|
rm -f $f |
|
else |
|
continue |
fi |
fi |
|
fi |
|
|
|
if [ -e "$f" ]; then |
|
true # verified above |
elif "$DOWNLOAD"; then |
elif "$DOWNLOAD"; then |
if "$DRYRUN"; then |
if "$DRYRUN"; then |
[ "$VERBOSE" -gt 0 ] && echo "Get/Verify ${f##*/}" |
[ "$VERBOSE" -gt 0 ] && echo "Get/Verify ${f##*/}" |