#!/bin/bash # This is for Bob, KB8ZXE. For adding intenet linking to a repeater # that has a single port controller. Essentially local receiver audio # is streamed to itself, back out the transmitter. While enabling # the ability to receive/transmit remote streams. # Instead of external hardware audio mixing we let linux be the mixer. # # This uses some X86 binaries for IRLP. (cosstate and key/ unkey) # ftp.irlp.net/pub/irlpv2.0 # IRLP uses parallel port pin 3 for PTT and pin 11 for COS # # The IRLP imike and ispeaker keying and unkey do not work in duplex, so # we use speak freely (sfmike and sfspeaker) # http://speak-freely.sourceforge.net # And do the keying by this looped script # # Set inital COS state LAST="0" # Poll the cosstate over and over, and set a state flag/variable while true do if ./cosstate then STATE="0" else STATE="1" fi ################################## # Check to see if the state has changed as we only want to perform # funtions on its change # if [ $STATE -ne $LAST ]; then echo "COS state is:" $STATE NEW=$STATE ## COS is active if [ $NEW = 1 ]; then echo "KEY" # Key and begin streaming ./key ./sfmike -A -N -P127.0.0.1 & fi ## COS is inactive if [ $NEW = 0 ]; then echo "UNKEY" # Unkey and end the stream ./unkey killall -TERM sfmike > /dev/null 2&>1 fi fi # LAST=$STATE sleep .1 done