Enhanced BASH scripts to detect either pm3-x or ttyACMx style devices.
This commit is contained in:
parent
c73ad5b4da
commit
15aa741bdc
10
proxmark3.sh
10
proxmark3.sh
@@ -1,12 +1,14 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
function wait4proxmark {
|
function wait4proxmark {
|
||||||
echo "Waiting for Proxmark to appear..."
|
echo >&2 "Waiting for Proxmark to appear..."
|
||||||
while [ ! -e /dev/ttyACM? ]; do
|
while [ ! -c /dev/ttyACM? -a ! -L /dev/pm3-? ]; do
|
||||||
sleep .1
|
sleep .1
|
||||||
done
|
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
|
# start proxmark with first detected interface
|
||||||
wait4promark
|
client/proxmark3 $(wait4proxmark)
|
||||||
client/proxmark3 /dev/ttyACM?
|
|
||||||
|
|||||||
13
update.sh
13
update.sh
@@ -1,16 +1,17 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
function wait4proxmark {
|
function wait4proxmark {
|
||||||
echo "Waiting for Proxmark to appear..."
|
echo >&2 "Waiting for Proxmark to appear..."
|
||||||
while [ ! -e /dev/ttyACM? ]; do
|
while [ ! -c /dev/ttyACM? -a ! -L /dev/pm3-? ]; do
|
||||||
sleep .1
|
sleep .1
|
||||||
done
|
done
|
||||||
|
local PM3=`ls -1 /dev/pm3-? /dev/ttyACM? 2>/dev/null | head -1`
|
||||||
|
echo >&2 -e "Found proxmark on ${PM3}\n"
|
||||||
|
echo $PM3
|
||||||
}
|
}
|
||||||
|
|
||||||
# flash bootroom
|
# flash bootroom
|
||||||
wait4proxmark
|
client/flasher $(wait4proxmark) -b bootrom/obj/bootrom.elf
|
||||||
client/flasher /dev/ttyACM? -b bootrom/obj/bootrom.elf
|
|
||||||
|
|
||||||
# flash system image
|
# flash system image
|
||||||
wait4proxmark
|
client/flasher $(wait4proxmark) armsrc/obj/fullimage.elf
|
||||||
client/flasher /dev/ttyACM? armsrc/obj/fullimage.elf
|
|
||||||
|
|||||||
Reference in New Issue
Block a user