Add scripts to make host nums file

This commit is contained in:
Donald Burr 2015-02-17 22:29:19 -08:00
parent b66bf4d8d3
commit 4b799bb44b
3 changed files with 31 additions and 4 deletions

2
acatcher/.gitignore vendored
View file

@ -1,2 +1,4 @@
acatcher acatcher
*.o *.o
HOSTS
SERVERIP

16
acatcher/mkhosts Executable file
View file

@ -0,0 +1,16 @@
#!/bin/sh
NUM=0
while read FOO; do
if ! echo $FOO | grep -q ^#; then
HOST="`echo $FOO | cut -d\| -f3`"
IP="`echo $FOO | cut -d\| -f2`"
if ! echo $HOST | egrep -q "(server|spare)"; then
>&2 echo found host $HOST ip $IP num $NUM
echo "$HOST:$IP:$NUM"
NUM=$((NUM+1))
elif echo $HOST | grep -q server; then
>&2 echo found server at ip $IP
echo $IP > SERVERIP
fi
fi
done < $HOME/Dropbox/CAMS > HOSTS

View file

@ -1,11 +1,20 @@
#!/bin/sh #!/bin/sh
SERVERIP=192.168.24.20 SERVERIP=`cat SERVERIP`
SESSION_ID="01" HOSTNAME=`hostname`
NUM=`grep ^$HOSTNAME: HOSTS | cut -d: -f3`
if [ -z "$NUM" ]; then
echo "error: could not find host number for `hostname`!"
exit 1
fi
ASESSION=$((4000+NUM))
VSESSION=$((4100+NUM))
echo "i am $HOSTNAME machine $NUM asession $ASESSION vsession $VSESSION server at $SERVERIP"
exit 1
# different res is ok, MUST be mjpg # different res is ok, MUST be mjpg
v4l2-ctl --set-fmt-video=width=640,height=480,pixelformat=MJPG v4l2-ctl --set-fmt-video=width=640,height=480,pixelformat=MJPG
amixer -c 1 sset Mic,0 80%,80% unmute cap amixer -c 1 sset Mic,0 80%,80% unmute cap
(while true; do arecord -t raw -c 1 -f S16_LE -r 22050 -D hw:1 | nc $SERVERIP 40$SESSION_ID; sleep 1; done) & (while true; do arecord -t raw -c 1 -f S16_LE -r 22050 -D hw:1 | nc $SERVERIP $ASESSION; sleep 1; done) &
while true; do ./v4lcap -o | nc $SERVERIP 41$SESSION_ID; sleep 1; done while true; do ./v4lcap -o | nc $SERVERIP $VSESSION; sleep 1; done