#!/bin/sh # # connection_status script for IRLP v0.1 - Robert Pectol (kk7av) # Announces the connection status of your node without having # to attempt a connection. # ###################################################################### ################################ # USER CONFIGURABLE SETTINGS # ################################ # AUX line PTT support aux_line_ptt="no" aux_line="1" ############################## # END USER CONFIG SETTINGS # ############################## # ensure script is run as repeater user if [ `/usr/bin/whoami` != "repeater" ] ; then exit 1 fi # ensure the environment file has been sourced if [ "$RUN_ENV" != "TRUE" ] ; then . /home/irlp/custom/environment fi # make sure festival is available if ! `which festival &>/dev/null`; then echo "Festival NOT installed! Do, 'yum install festival' as root to install it." exit 1 fi # for AUX line PTT support if [ "$aux_line_ptt" == "yes" ]; then tx_key=`echo "$BIN/aux$aux_line""on"` tx_unkey=`echo "$BIN/aux$aux_line""off"` else tx_key=`echo "$BIN/key"` tx_unkey=`echo "$BIN/unkey"` fi $tx_key sleep .5 if [[ -f "$LOCAL/echo_active" || -f "$LOCAL/active" ]]; then killall sfswrapper > /dev/null 2>&1 killall ispeaker > /dev/null 2>&1 fi if [ -f $LOCAL/active ]; then if [ -f $LOCAL/echo_active ]; then result=`cat $LOCAL/echo_active | gawk 'BEGIN { FS = "" }{for (i = 1; i <= NF; i = i + 1) print $i}'` result=`echo "Station, $result."` link="Echo Link," else result=`cat $LOCAL/active | sed 's/ref//; s/stn//' | gawk 'BEGIN { FS = "" }{for (i = 1; i <= NF; i = i + 1) print $i}'` ref=`cat $LOCAL/active | egrep '^ref'` if [ "$ref" == "" ]; then result=`echo "Node number, $result."` else result=`echo "Ree flector, $result."` fi link="I R L P," fi echo "Connected too. $link $result." | festival --tts else echo "Not connected." | festival --tts fi $tx_unkey if [[ -f "$LOCAL/echo_active" || -f "$LOCAL/active" ]]; then $SCRIPT/sfswrapper fi exit 0