How to upload a sketch to all connected board

For das Körperrauschen project, I use an array of 5 Arduino micro and since they are plugged inside the sculpture, it is not convenient to unplugged them for upgrading one by one. And as I’m a lazy boy I search a way to upgrade them all at the same time. Since they run all the same code, I just made a simple script to upload all the connected board one by one.

Here is the script :

#!/bin/bash

for arduino in /dev/ttyACM* ;
do
ino upload -m micro -p $arduino
sleep 1
done

It searches all serial interfaces that looks like Arduino (/dev/ttyACM* on Ubuntu) and uses inotool to upload the sketch to them. Of course the folder should have the structure required by inotool.
Without delay, I can’t access the next board, and I don’t know why…