Merge pull request #49 from FintasticMan/apply_shellcheck
Apply changes suggested by shellcheck
This commit is contained in:
commit
185cc2bc29
13
backup.sh
13
backup.sh
|
@ -2,20 +2,19 @@
|
||||||
|
|
||||||
BKPPATH="firmware-backups"
|
BKPPATH="firmware-backups"
|
||||||
|
|
||||||
mkdir -p $BKPPATH
|
mkdir -p "$BKPPATH"
|
||||||
|
|
||||||
NOW=$(date +%s)
|
NOW=$(date +%s)
|
||||||
|
|
||||||
num=$(ls -l /dev/ttyACM* | rev | cut -c 1)
|
num=$(find /dev -name 'ttyACM*' | sort | rev | cut -c 1)
|
||||||
echo com is:$num
|
echo com is: "$num"
|
||||||
splitPorts=($num)
|
mapfile -t splitPorts <<< "$num"
|
||||||
echo "This tool assumes your buds are the only thing connected and are enumerated {right,left} order. YMMV"
|
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 "Right bud is at ${splitPorts[0]}"
|
||||||
echo "Left bud is at ${splitPorts[1]}"
|
echo "Left bud is at ${splitPorts[1]}"
|
||||||
|
|
||||||
echo "Please disconnect and reconnect the bud on the right"
|
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"
|
||||||
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"
|
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
|
bestool read-image --port "/dev/ttyACM${splitPorts[1]}" "${BKPPATH}/firmware-${NOW}-${splitPorts[1]}.bin.bkp"
|
||||||
|
|
8
build.sh
8
build.sh
|
@ -1,10 +1,8 @@
|
||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
|
|
||||||
make -j T=open_source DEBUG=1 >log.txt 2>&1
|
if make -j "$(nproc)" T=open_source DEBUG=1 >log.txt 2>&1; then
|
||||||
|
|
||||||
if [ $? -eq 0 ]; then
|
|
||||||
echo "build success"
|
echo "build success"
|
||||||
else
|
else
|
||||||
echo "build failed and call log.txt"
|
echo "build failed and call log.txt"
|
||||||
cat log.txt | grep "error:*"
|
grep "error:" log.txt
|
||||||
fi
|
fi
|
||||||
|
|
5
clear.sh
5
clear.sh
|
@ -1,2 +1,3 @@
|
||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
make T=open_source -j DEBUG=1 clean
|
|
||||||
|
make -j "$(nproc)" T=open_source DEBUG=1 clean
|
||||||
|
|
11
download.sh
11
download.sh
|
@ -1,15 +1,14 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
num=$(ls -l /dev/ttyACM* | rev | cut -c 1)
|
num=$(find /dev -name 'ttyACM*' | sort | rev | cut -c 1)
|
||||||
echo com is:$num
|
echo com is: "$num"
|
||||||
splitPorts=($num)
|
mapfile -t splitPorts <<< "$num"
|
||||||
echo "This tool assumes your buds are the only thing connected and are enumerated {right,left} order. YMMV"
|
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 "Right bud is at ${splitPorts[0]}"
|
||||||
echo "Left bud is at ${splitPorts[1]}"
|
echo "Left bud is at ${splitPorts[1]}"
|
||||||
|
|
||||||
echo "Please disconnect and reconnect the bud on the right"
|
echo "Please disconnect and reconnect the bud on the right"
|
||||||
|
bestool write-image out/open_source/open_source.bin --port "/dev/ttyACM${splitPorts[0]}"
|
||||||
bestool write-image out/open_source/open_source.bin --port /dev/ttyACM${splitPorts[0]}
|
|
||||||
|
|
||||||
echo "Please disconnect and reconnect the bud on the left"
|
echo "Please disconnect and reconnect the bud on the left"
|
||||||
bestool write-image out/open_source/open_source.bin --port /dev/ttyACM${splitPorts[1]}
|
bestool write-image out/open_source/open_source.bin --port "/dev/ttyACM${splitPorts[1]}"
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
#! /bin/bash
|
#!/bin/sh
|
||||||
|
|
||||||
num=$(ls -l /dev/ttyUSB* | rev | cut -c 1)
|
num=$(find /dev -name 'ttyUSB*' | rev | cut -c 1)
|
||||||
#num=1
|
echo "$num"
|
||||||
echo $num
|
sudo minicom "port$num"
|
||||||
sudo minicom port$num
|
|
||||||
|
|
Loading…
Reference in New Issue