Skip to content

Commit

Permalink
pm3 script for linux: alternative if udevadm is not available (termux)
Browse files Browse the repository at this point in the history
  • Loading branch information
doegox committed May 16, 2020
1 parent c8e281c commit 4edea34
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions pm3
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,19 @@ function get_pm3_list_Linux {
N=$1
PM3LIST=()
for DEV in $(find /dev/ttyACM* 2>/dev/null); do
if udevadm info -q property -n "$DEV" | grep -q "ID_VENDOR=proxmark.org"; then
PM3LIST+=("$DEV")
if [ ${#PM3LIST[*]} -ge $N ]; then
return
if which udevadm >/dev/null; then
if udevadm info -q property -n "$DEV" | grep -q "ID_VENDOR=proxmark.org"; then
PM3LIST+=("$DEV")
if [ ${#PM3LIST[*]} -ge $N ]; then
return
fi
fi
else
if grep -q "PRODUCT=9ac4/4b8f" "/sys/class/tty/${DEV#/dev/}/../../uevent" 2>/dev/null; then
PM3LIST+=("$DEV")
if [ ${#PM3LIST[*]} -ge $N ]; then
return
fi
fi
fi
done
Expand Down

0 comments on commit 4edea34

Please sign in to comment.