=================================================================== RCS file: /cvs/openbsd/fw_update/fw_install.sh,v retrieving revision 1.147 retrieving revision 1.148 diff -u -r1.147 -r1.148 --- openbsd/fw_update/fw_install.sh 2022/01/09 03:02:38 1.147 +++ openbsd/fw_update/fw_install.sh 2022/01/11 02:48:11 1.148 @@ -1,5 +1,5 @@ #!/bin/ksh -# $OpenBSD: fw_install.sh,v 1.147 2022/01/09 03:02:38 afresh1 Exp $ +# $OpenBSD: fw_install.sh,v 1.148 2022/01/11 02:48:11 afresh1 Exp $ # # Copyright (c) 2021 Andrew Hewus Fresh # @@ -438,7 +438,7 @@ for f in "${devices[@]}"; do d="$( firmware_devicename "$f" )" - verify_existing="$DOWNLOAD" + verify_existing=true if [ "$f" = "$d" ]; then f=$( firmware_filename "$d" || true ) [ "$f" ] || continue @@ -464,19 +464,24 @@ done fi - if [ -e "$f" ]; then - if "$DOWNLOAD"; then - if "$verify_existing" && ! "$DRYRUN"; then - [ "$VERBOSE" -gt 1 ] && ! "$INSTALL" && - echo "Keep/Verify ${f##*/}" - verify "$f" || continue - else - [ "$VERBOSE" -gt 1 ] && ! "$INSTALL" && - echo "Keep ${f##*/}" - fi + if "$verify_existing" && [ -e "$f" ]; then + msg="Keep/Verify" + "$INSTALL" && msg="Verify" + [ "$VERBOSE" -gt 1 ] && ! "$INSTALL" && + echo "$msg ${f##*/}" + + if "$DRYRUN" || verify "$f"; then "$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 + + if [ -e "$f" ]; then + true # verified above elif "$DOWNLOAD"; then if "$DRYRUN"; then [ "$VERBOSE" -gt 0 ] && echo "Get/Verify ${f##*/}"