################# ANNOUNCE SCRIPT ###################################### # This needs to be added to your custom.crons: # # Execute the scripT at the top of the hour # 0 * * * * (/home/irlp/custom/announce > /dev/null 2>&1) ######################################################################## #Create and add a .wav file to /home/irlp/custom in a file called my_id #This should be 8 bit mono like the stnon/off files. #Need to "chmod 750 announce" after editing it. ######################################################################## #!/bin/bash # # This is a script that will play a .wav file message locally over the IRLP node. #Modified by W2YMM # ###################################################3 # Defines # System Globals . /home/irlp/custom/environment # Make sure we are user repeater!!! if [ `/usr/bin/whoami` != "repeater" ] ; then echo This program must be run as user REPEATER! exit 1 fi # Check to see if we have a file available # If the file exists, and is nonzero in size, we sleep and move on if [ -s /home/irlp/audio/my_id.wav ] ; then usleep 1 else exit 1 fi # With ! added this script will only id if not in use. if [ ! -f /home/irlp/local/active ] ; then usleep 1 else exit 1 fi # Check to see if we have a newsline like thing playing. If so, # We won't be able to ID. Skip out. if [ -f /home/irlp/local/noid ] ; then exit 1 fi if [ "$DTMF_ONOFF_MACROS" = "YES" ] ; then MACROFILE=macros/custom_off fi # Loop if the repeater is busy while [ TRUE ] do if $BIN/cosstate then if $BIN/pttstate then break fi fi echo -en "\rCOS or PTT is active " sleep .4 done # Ok, we are at this point, assuming that the repeater is not locally # busy. killall ispeaker killall ispeaker_PCI killall sfswrapper # Start playing the files # Log the activity to the log file $BIN/key sleep .2 if [ -s /home/irlp/audio/my_id.wav ] ; then $BIN/play /home/irlp/audio/my_id.wav >/dev/null 2>&1 date >> /home/irlp/log/myid.txt fi # Turn on IRLP for normal use if [ -f "$LOCAL"/active ]; then "$SCRIPT"/sfswrapper fi # Ok, time hang up the repeater $BIN/unkey exit 0