Newer
Older
Tardis / scripts / findboard.sh
@Jookia Jookia on 19 Mar 2023 434 bytes Initial commit
#!/bin/bash
set -e
SERIALPATH="$PWD/.boardserial"
USBDIR=/sys/bus/usb/devices
cd $USBDIR
for DEV in *; do
	cd "$USBDIR/$DEV"
	test -e idVendor -a -e idProduct || continue
	ID="$(cat idVendor):$(cat idProduct)"
	test "$ID" = "0483:374b" || continue
	cp serial "$SERIALPATH"
	echo "Found board!"
	exit 0
done
echo "Couldn't find board, please re-connect and run again."
echo "Make sure you have run 'sudo scripts/setup-udev.sh'"
exit 1