[BACK]Return to fw_install.sh CVS log [TXT][DIR] Up to [local] / openbsd / fw_update

Diff for /openbsd/fw_update/fw_install.sh between version 1.121 and 1.122

version 1.121, 2021/12/24 02:27:46 version 1.122, 2021/12/24 02:36:13
Line 241 
Line 241 
 }  }
   
 usage() {  usage() {
         echo "usage:  ${0##*/} [-d | -D | -L] [-av] [-p path] [driver | file ...]"          echo "usage:  ${0##*/} [-d | -D] [-av] [-p path] [driver | file ...]"
         exit 2          exit 2
 }  }
   
 ALL=false  ALL=false
 OPT_D=  OPT_D=
 OPT_L=  while getopts :adDp:v name
 while getopts :adDLp:v name  
 do  do
        case "$name" in         case "$name" in
        a) ALL=true ;;         a) ALL=true ;;
        d) DELETE=true ;;         d) DELETE=true ;;
        D) OPT_D=true ;;         D) OPT_D=true ;;
        L) OPT_L=true ;;  
        p) LOCALSRC="$OPTARG" ;;         p) LOCALSRC="$OPTARG" ;;
        v) VERBOSE=true ;;         v) VERBOSE=true ;;
        :)         :)
Line 269 
Line 267 
 done  done
 shift $((OPTIND - 1))  shift $((OPTIND - 1))
   
 [ "$OPT_D" ] && [ "$OPT_L" ] && usage 1  
   
 if [ "$LOCALSRC" ]; then  if [ "$LOCALSRC" ]; then
         if [[ $LOCALSRC = @(ftp|http?(s))://* ]]; then          if [[ $LOCALSRC = @(ftp|http?(s))://* ]]; then
                 FWURL="${LOCALSRC}"                  FWURL="${LOCALSRC}"
                 LOCALSRC=                  LOCALSRC=
         else          else
                 # If we've not specifically asked to download to this path  
                 # then we are installing from the local dir and no downloading.  
                 [ "$OPT_D" ] || DOWNLOAD=false  
                 LOCALSRC="${LOCALSRC:#file:}"                  LOCALSRC="${LOCALSRC:#file:}"
   
                 ! [ -d "$LOCALSRC" ] &&                  ! [ -d "$LOCALSRC" ] &&
                     echo "The path must be a URL or an existing directory" >&2 &&                      echo "The path must be a URL or an existing directory" >&2 &&
                     exit 2                      exit 2
         fi          fi
 fi  fi
   
   # "Download only" means local dir and don't install
 if [ "$OPT_D" ]; then  if [ "$OPT_D" ]; then
         # "Download only" means local dir and don't install  
         INSTALL=false          INSTALL=false
         LOCALSRC="${LOCALSRC:-.}"          LOCALSRC="${LOCALSRC:-.}"
 elif [ "$OPT_L" ]; then  
         # "Local" means don't download, install from local dir  
         DOWNLOAD=false  
         LOCALSRC="${LOCALSRC:-.}"  
 elif [ ! "$LOCALSRC" ]; then  
         LOCALSRC="$( tmpdir "${DESTDIR}/tmp/${0##*/}" )"  
 fi  fi
   
   [ "$LOCALSRC" ] || LOCALSRC="$( tmpdir "${DESTDIR}/tmp/${0##*/}" )"
   
 CFILE="$LOCALSRC/$CFILE"  CFILE="$LOCALSRC/$CFILE"
   
 if [ -x /usr/bin/id ] && [ "$(/usr/bin/id -u)" != 0 ]; then  if [ -x /usr/bin/id ] && [ "$(/usr/bin/id -u)" != 0 ]; then
Line 309 
Line 297 
 set -A devices -- "$@"  set -A devices -- "$@"
   
 if "$DELETE"; then  if "$DELETE"; then
         [ "$OPT_D" ] || [ "$OPT_L" ] && usage 22          [ "$OPT_D" ] && usage 22
   
         set -A installed          set -A installed
         if [ "${devices[*]:-}" ]; then          if [ "${devices[*]:-}" ]; then

Legend:
Removed from v.1.121  
changed lines
  Added in v.1.122

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>