Enhanced BASH scripts to detect either pm3-x or ttyACMx style devices.

This commit is contained in:
57ca2b96b7444cb986b2d6cf51d25ffd86c57743 2017-10-23 19:25:58 -04:00
commit 15aa741bdc
2 changed files with 13 additions and 10 deletions

View file

@ -1,12 +1,14 @@
#!/bin/bash
function wait4proxmark {
echo "Waiting for Proxmark to appear..."
while [ ! -e /dev/ttyACM? ]; do
echo >&2 "Waiting for Proxmark to appear..."
while [ ! -c /dev/ttyACM? -a ! -L /dev/pm3-? ]; do
sleep .1
done
local PM3=`ls -1 /dev/pm3-? /dev/ttyACM? 2>/dev/null | head -1`
echo >&2 -e "Found proxmark on ${PM3}\n"
echo $PM3
}
# start proxmark with first detected interface
wait4promark
client/proxmark3 /dev/ttyACM?
client/proxmark3 $(wait4proxmark)