=================================================================== RCS file: /cvs/openbsd/fw_update/fw_install.sh,v retrieving revision 1.116 retrieving revision 1.118 diff -u -r1.116 -r1.118 --- openbsd/fw_update/fw_install.sh 2021/12/23 21:46:46 1.116 +++ openbsd/fw_update/fw_install.sh 2021/12/24 00:46:02 1.118 @@ -1,5 +1,5 @@ #!/bin/ksh -# $OpenBSD: fw_install.sh,v 1.116 2021/12/23 21:46:46 afresh1 Exp $ +# $OpenBSD: fw_install.sh,v 1.118 2021/12/24 00:46:02 afresh1 Exp $ # # Copyright (c) 2021 Andrew Hewus Fresh # @@ -277,11 +277,9 @@ CFILE="$LOCALSRC/$CFILE" -if "$INSTALL" || "$DELETE"; then - if [ -x /usr/bin/id ] && [ "$(/usr/bin/id -u)" != 0 ]; then - echo "need root privileges" >&2 - exit 1 - fi +if [ -x /usr/bin/id ] && [ "$(/usr/bin/id -u)" != 0 ]; then + echo "need root privileges" >&2 + exit 1 fi set -A devices -- "$@" @@ -376,11 +374,13 @@ if "$DOWNLOAD"; then "$VERBOSE" && echo "Verify existing ${f##*/}" verify "$f" || continue + "$INSTALL" || kept="$kept,$d" # else assume it was verified when downloaded fi elif "$DOWNLOAD"; then fetch "$f" || continue verify "$f" || continue + "$INSTALL" || added="$added,$d" elif "$INSTALL"; then echo "Cannot install ${f##*/}, not found" >&2 continue @@ -408,4 +408,8 @@ added="${added:#,}" updated="${updated:#,}" kept="${kept:#,}" -echo "${0##*/}: added ${added:-none}; updated ${updated:-none}; kept ${kept:-none}" +if "$INSTALL"; then + echo "${0##*/}: added ${added:-none}; updated ${updated:-none}; kept ${kept:-none}" +else + echo "${0##*/}: downloaded ${added:-none}; kept ${kept:-none}" +fi