2017-10-24 06:15:02 +08:00
|
|
|
#!/bin/bash
|
|
|
|
|
2018-08-17 00:31:12 +08:00
|
|
|
function wait4proxmark_Linux {
|
2019-03-09 18:10:22 +08:00
|
|
|
echo >&2 "Waiting for Proxmark to appear..."
|
2019-03-14 19:30:32 +08:00
|
|
|
while [ ! -c /dev/ttyACM? -a ! -c /dev/pm3-? ]; do
|
2019-03-09 18:10:22 +08:00
|
|
|
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
|
2017-10-24 06:15:02 +08:00
|
|
|
}
|
|
|
|
|
2018-08-16 22:22:54 +08:00
|
|
|
function wait4proxmark_macOS {
|
2019-03-09 18:10:22 +08:00
|
|
|
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
|
2018-08-16 22:22:54 +08:00
|
|
|
}
|
|
|
|
|
2017-10-24 06:15:02 +08:00
|
|
|
# start proxmark with first detected interface
|
2018-08-16 22:22:54 +08:00
|
|
|
|
|
|
|
if [[ $(uname | awk '{print toupper($0)}') == "LINUX" ]]; then
|
2019-04-15 20:02:21 +08:00
|
|
|
client/proxmark3 $(wait4proxmark_Linux) "$@"
|
2018-08-16 22:22:54 +08:00
|
|
|
elif [[ $(uname | awk '{print toupper($0)}') == "DARWIN" ]]; then
|
2019-04-15 20:02:21 +08:00
|
|
|
client/proxmark3 $(wait4proxmark_macOS) "$@"
|
2018-08-16 22:22:54 +08:00
|
|
|
fi
|