You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
1.2 KiB

#!/bin/bash
########################################################################
#
#
# filename: playWxRpt
#
# description: This script will play the weather report audio files
# that get created by the getWxRpt script.
#
# history:
# 20030818 kc6hur Origial release
#
# Modified by W0ANM
# $Id: playWxRpt 31 2009-01-05 02:52:02Z $
########################################################################
# Load config file
if [ -f ${CUSTOM}/wx_scripts.conf ] ; then
source ${CUSTOM}/wx_scripts.conf
else
echo "Missing ${CUSTOM}/wx_scripts.conf file, aborting..."
exit 1
fi
# if ICAO_STN not an argument, then use what is defined in configure file.
if [ "$1" = "" ] ; then
ICAO_LIST=$ICAO_STN
else
ICAO_LIST=$1
fi
if [ $ACTIVE_PLAY = "FALSE" ] ; then
if [ -f ${LOCAL}/active ] ; then
echo "${0##*/}: ERROR - Node is busy, must be idle to run."
exit 1
fi
fi
if [ $ACTIVE_PLAY = "FALSE" ] ; then
touch ${LOCAL}/active
fi
if [ -f ${CUSTOM}/custom_wavplay ] ; then
${CUSTOM}/custom_wavplay custom/wx/report/$ICAO_LIST &> /dev/null 2>&1
else
/usr/sbin/asterisk -rx "rpt localplay 27539 /custom/wx/report/$ICAO_LIST" &> /dev/null 2>&1
fi
if [ $ACTIVE_PLAY = "FALSE" ] ; then
rm ${LOCAL}/active
fi
exit 0

Powered by TurnKey Linux.