From cbe74d8400cdb088e865916f0a71f614423a88e7 Mon Sep 17 00:00:00 2001 From: TomHarkness Date: Thu, 16 Aug 2018 21:47:02 +1000 Subject: [PATCH] Updated update.sh from iceman1001/proxmark3 - by joanbono --- update.sh | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/update.sh b/update.sh index f416cbf90..3546cc3d1 100755 --- a/update.sh +++ b/update.sh @@ -1,6 +1,6 @@ #!/bin/bash -function wait4proxmark { +function wait4proxmark_Linux { echo >&2 "Waiting for Proxmark to appear..." while [ ! -c /dev/ttyACM? -a ! -L /dev/pm3-? ]; do sleep .1 @@ -10,5 +10,23 @@ function wait4proxmark { echo $PM3 } -# flash bootroom & system image -client/flasher $(wait4proxmark) -b bootrom/obj/bootrom.elf armsrc/obj/fullimage.elf +function wait4proxmark_macOS { + echo >&2 "Waiting for Proxmark to appear..." + while true; do + PM3=$(ls /dev/pm3-* /dev/cu.usbmodem* 2>/dev/null | head -1) + if [[ $PM3 != "" ]]; then + #echo >&2 -e "Found proxmark on $(ls /dev/pm3-* /dev/cu.usbmodem* 2>/dev/null | head -1)\n" + break + fi + sleep .1 + done + echo $PM3 +} + +# Detect OS and flash bootroom & system image + +if [[ $(uname | awk '{print toupper($0)}') == "LINUX" ]]; then + client/flasher $(wait4proxmark_Linux) -b bootrom/obj/bootrom.elf armsrc/obj/fullimage.elf +elif [[ $(uname | awk '{print toupper($0)}') == "DARWIN" ]]; then + client/flasher $(wait4proxmark_macOS) -b bootrom/obj/bootrom.elf armsrc/obj/fullimage.elf +fi