From cc1738ef0bdf5e6a9cfc58086a10618800400ec2 Mon Sep 17 00:00:00 2001 From: Thatcher Chamberlin Date: Wed, 4 Jan 2023 20:55:59 -0500 Subject: [PATCH] Added backup.sh script --- .gitignore | 1 + backup.sh | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100755 backup.sh diff --git a/.gitignore b/.gitignore index dabe86e..b2615e8 100644 --- a/.gitignore +++ b/.gitignore @@ -25,6 +25,7 @@ *.BAK *.orig \#*# +firmware-backups/ # Tag files /tags diff --git a/backup.sh b/backup.sh new file mode 100755 index 0000000..bf16c33 --- /dev/null +++ b/backup.sh @@ -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