#!/bin/bash echo "Watching for XIAO bootloader... wiggle your RST wire!" echo "Will flash as soon as it appears." while true; do if lsusb | grep -qi "2886"; then echo "FOUND IT! Flashing now..." export PATH="$HOME/.cargo/bin:$PATH" cargo hf2 --release 2>&1 echo "Done. Exit code: $?" break fi sleep 0.1 done