=================================================================== RCS file: /cvs/openbsd/fw_update/fw_install.sh,v retrieving revision 1.132 retrieving revision 1.137 diff -u -r1.132 -r1.137 --- openbsd/fw_update/fw_install.sh 2021/12/25 19:08:52 1.132 +++ openbsd/fw_update/fw_install.sh 2021/12/26 18:39:46 1.137 @@ -1,5 +1,5 @@ #!/bin/ksh -# $OpenBSD: fw_install.sh,v 1.132 2021/12/25 19:08:52 afresh1 Exp $ +# $OpenBSD: fw_install.sh,v 1.137 2021/12/26 18:39:46 afresh1 Exp $ # # Copyright (c) 2021 Andrew Hewus Fresh # @@ -97,7 +97,7 @@ SECONDS=0 sleep 1 else - kill -INT -"$FTPPID" + kill -INT -"$FTPPID" 2>/dev/null _error=" (timed out)" fi else @@ -132,7 +132,7 @@ # When we're not in the installer, the dmesg.boot can # contain multiple boots, so only look in the last one - _dmesgtail="$( echo ; sed -n 'H;/^OpenBSD/h;${g;p;}' /var/run/dmesg.boot ) + _dmesgtail="$( echo ; sed -n 'H;/^OpenBSD/h;${g;p;}' /var/run/dmesg.boot )" grep -v '^[[:space:]]*#' "$FWPATTERNS" | while read -r _d _m; do @@ -183,14 +183,14 @@ set -sA _devices -- $( firmware_in_dmesg for _d in $( installed_firmware '*' '-firmware-' '*' ); do - echo "$( firmware_devicename "$_d" )" + firmware_devicename "$_d" done ) [ "${_devices[*]:-}" ] || return 0 for _d in "${_devices[@]}"; do - [[ $_last = $_d ]] && continue - echo $_d + [ "$_last" = "$_d" ] && continue + echo "$_d" _last="$_d" done } @@ -354,7 +354,7 @@ if [ "${installed:-}" ]; then for fw in "${installed[@]}"; do if "$DRYRUN"; then - echo "Delete $fw" + "$VERBOSE" && echo "Delete $fw" else delete_firmware "$fw" || continue fi @@ -427,12 +427,8 @@ if [ -e "$f" ]; then if "$DOWNLOAD"; then - if "$VERBOSE"; then - "$INSTALL" && - echo "Verify ${f##*/}" || - echo "Keep/Verify ${f##*/}" - echo "Verify ${f##*/}" - fi + "$VERBOSE" && ! "$INSTALL" && + echo "Keep/Verify ${f##*/}" "$DRYRUN" || verify "$f" || continue "$INSTALL" || kept="$kept,$d" # else assume it was verified when downloaded @@ -465,10 +461,10 @@ f="${f##*/}" f="${f%.tgz}" if "$removed"; then - "$DRYRUN" && echo "Update $f" + "$DRYRUN" && "$VERBOSE" && echo "Update $f" updated="$updated,$d" else - "$DRYRUN" && echo "Install $f" + "$DRYRUN" && "$VERBOSE" && echo "Install $f" added="$added,$d" fi done