#!/bin/bash # first device connected idf.py -DROLE=SENDER build ret_val=$? if (($ret_val != 0)); then exit fi if [$1 == '']; then idf.py -p /dev/ttyUSB1 -b 2000000 flash && idf.py -p /dev/ttyUSB1 monitor -B 450000 else idf.py -p $1 flash && idf.py -p $1 monitor -B 450000 fi