#!/bin/bash
# options
NUM_DEVS=2
# initialize an Array
DEV=(/dev/ttyACM0,/dev/ttyACM1);
## Script Begin ##
COUNTER=0
FOUND=0
echo -e "Searching for devices...please wait\t"
while (( 1 )); do
if [ -c /dev/ttyACM$COUNTER ]; then
DEV[$FOUND]="/dev/ttyACM$COUNTER";
(( FOUND++ ))
fi
if (( $FOUND >= $NUM_DEVS )); then
break
fi
((COUNTER++))
sleep .5
# Change Counter value check based on number of devices
if (( $COUNTER >=10 )); then
echo -e "Found only $FOUND devices out of $NUM_DEVS...Please check USB connections & devices.\n\nExiting...\n"
exit 1
fi
done
echo -e "Found devices ${DEV[0]}, ${DEV[1]}\n"
### End bash script
HTH...
There's no need for something so complicated. This will work just fine:
minerd -o stratum+tcp://pool.com -u USERNAME -p PASSWORD --gc3355-autotune --gc3355=`ls -m /dev/ttyACM* | sed -e 's/, /,/g' | tr -d '\n'` --freq=1200