diff options
Diffstat (limited to 'misc/drivers/rtl8187x/INSTALL.sh')
-rwxr-xr-x | misc/drivers/rtl8187x/INSTALL.sh | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/misc/drivers/rtl8187x/INSTALL.sh b/misc/drivers/rtl8187x/INSTALL.sh index 5e727be42..64b9fd1c6 100755 --- a/misc/drivers/rtl8187x/INSTALL.sh +++ b/misc/drivers/rtl8187x/INSTALL.sh @@ -44,16 +44,20 @@ dest="drivers/usbhost" # Parse command arguments -usage="USAGE: $0 [-d|h] -t <driver-dir> -n <nuttx-dir>" +usage="USAGE: $0 [-d|f|h] -t <driver-dir> -n <nuttx-dir>" unset topdir unset nuttxdir +unset force while [ ! -z "$1" ]; do case "$1" in -d ) set -x ;; + -f ) + force=y + ;; -t ) shift topdir=$1 @@ -115,9 +119,15 @@ for file in ${files}; do fi if [ -f ${nuttxdir}/${dest}/${file} ]; then echo "Driver file ${nuttxdir}/${dest}/${file} already exists" - echo "Please remove that file and re-start the installation" - exit 8 + if [ "X${force}" = "Xy" ]; then + echo "Removing old file ${nuttxdir}/${dest}/${file}" + rm -f ${nuttxdir}/${dest}/${file} || \ + { echo "ERROR: failed to remove ${nuttxdir}/${dest}/${file}"; exit 8; } + else + echo "Please remove that file and re-start the installation" + exit 8 + fi fi cp ${topdir}/${file} ${nuttxdir}/${dest}/${file} || \ { echo "ERROR: failed to copy ${topdir}/${file} to ${nuttxdir}/${dest}/${file}"; exit 9; } -done
\ No newline at end of file +done |