#!/bin/bash FW="firmware/firmware.bin" if [ -f "$FW" ] then rm $FW fi (cd firmware && make APP=avrisp) echo -n "waiting for device in ISP mode" while [ ! -d "/dev/lpcflash" ] do echo -n "." sleep 1 done echo "" ISPDEV="/dev/"`ls /dev/lpcflash` echo "device detected as:" $ISPDEV if [ -f "$ISPDEV" ] then sudo umount $ISPDEV fi if [ -f "$FW" ] then echo "flashing $FW" dd if=$FW of=$ISPDEV bs=512 seek=4 sync echo "$FW flashed" fi