2 #Usage: serverctl action [servername] [minicom args]
5 DEVDIR
=/sys
/bus
/usb
/devices
/
8 ls $DEVDIR |
while read line
; do
9 if [ "`ls ${DEVDIR}/${line}/|grep tty|wc -l`" != "0" ]; then
10 tty
="`ls ${DEVDIR}/${line}/|grep tty`"
11 base
="`echo $line|cut -f1 -d:`"
12 m
="`cat ${DEVDIR}/${base}/manufacturer`"
13 p
="`cat ${DEVDIR}/${base}/product`"
14 s
="`cat ${DEVDIR}/${base}/serial`"
15 echo "$line;$base;$tty;$m;$p;$s"
24 if [ "`list_servers|grep $node|wc -l`" -eq
"0" ]; then
25 echo "No such node: $node"
32 list_servers|
while read line
; do
33 echo $line|
awk -F
";" '{print "/dev/"$3": "$4" "$5" "$6 }'
38 cp2103gpio
--serial
=$node --gpio
=3 --out
=0 --sleep $DELAY --out
=1
42 cp2103gpio
--serial
=$node --gpio
=3 --out
=0
46 cp2103gpio
--serial
=$node --gpio
=3 --out
=0
53 [ -z
"$*" ] && miniargs
="-b 115200"
54 tty
=/dev
/`list_servers|grep $node|cut -d";" -f3`
55 minicom
-o
-D
$tty $miniargs
58 echo "Server control utility"
59 echo "Usage: $0 action node"
60 echo "Valid actions are: "