Added backup.sh script

This commit is contained in:
Thatcher Chamberlin 2023-01-04 20:55:59 -05:00
parent 56d75943a1
commit cc1738ef0b
2 changed files with 22 additions and 0 deletions

1
.gitignore vendored
View File

@ -25,6 +25,7 @@
*.BAK
*.orig
\#*#
firmware-backups/
# Tag files
/tags

21
backup.sh Executable file
View File

@ -0,0 +1,21 @@
#! /bin/bash
BKPPATH="firmware-backups"
mkdir -p $BKPPATH
NOW=$(date +%s)
num=$(ls -l /dev/ttyACM* | rev | cut -c 1)
echo com is:$num
splitPorts=($num)
echo "This tool assumes your buds are the only thing connected and are enumerated {right,left} order. YMMV"
echo "Right bud is at ${splitPorts[0]}"
echo "Left bud is at ${splitPorts[1]}"
echo "Please disconnect and reconnect the bud on the right"
bestool read-image --port /dev/ttyACM${splitPorts[0]} $BKPPATH/firmware-$NOW-${splitPorts[0]}.bin.bkp
echo "Please disconnect and reconnect the bud on the left"
bestool read-image --port /dev/ttyACM${splitPorts[1]} $BKPPATH/firmware-$NOW-${splitPorts[1]}.bin.bkp