case $2 in on) switch=-n ;; off) switch=-f ;; *) echo "usage: $0 { on | off }" ;; esac case $1 in bedroom-phil) br -x /dev/ttyS0 $switch d1 ;; bedroom-dan) br -x /dev/ttyS0 $switch d5 ;; downstairs) for i in 3 4; do br -x /dev/ttyS0 $switch g$i sleep 10 done ;; fishtank) for i in 5 6; do br -x /dev/ttyS0 $switch g$i sleep 10 done ;; *) echo "Valid locations are: " echo "bedroom-phil bedroom-dan downstairs fishtank" ;; esac