#!/bin/sh

[ $# -ne 2 ] && echo "$0 {G or B} {channel}" && exit 1

case "${1}" in
G)
BW=11
break;;
B)
BW=12
break;;
*)break;;
esac

case "${2}" in
1)
CH=13
break;;
2)
CH=14
break;;
3)
CH=15
break;;
4)
CH=16
break;;
5)
CH=17
break;;
6)
CH=18
break;;
7)
CH=21
break;;
8)
CH=22
break;;
9)
CH=23
break;;
10)
CH=24
break;;
11)
CH=25
break;;
12)
CH=26
break;;
*)break;;
esac

stty -F /dev/ttyUSB0 9600
echo -e $BW\\r > /dev/ttyUSB0
sleep 1.5
echo -e 25\\r > /dev/ttyUSB0 # 11ch
sleep 1.5
echo -e $CH\\r > /dev/ttyUSB0
