[arm-allstar] Turn Scheduler On and Off with * code

David McGough kb4fxc at inttek.net
Tue Mar 7 23:57:06 EST 2023



Hi Earl,

To run multiple announcements, here is a little different approach. Try 
something like this:

......First, in the rpt.conf [functions] stanza:

; rpt.conf DTMF macros
980=cmd,/bin/cp /etc/asterisk/local/SkywarnActivation.ul /tmp/SWAEnabled.ul
981=cmd,/bin/rm /tmp/SWAEnabled.ul
;
982=cmd,/bin/cp /etc/asterisk/local/EmergencyCommunicationsActivation.ul /tmp/SWBEnabled.ul
983=cmd,/bin/rm /tmp/SWBEnabled.ul
;
984=cmd,/bin/cp /etc/asterisk/local/K4HOGDirectedNetAnnouncement.ul /tmp/SWCEnabled.ul
985=cmd,/bin/rm /tmp/SWCEnabled.ul
;

......And, the script run from the cron job would look like:


#!/bin/bash

source /usr/local/etc/allstar.env

for SA in $(find /tmp -name 'SW*Enabled.ul' -mmin +10) ; do

        if [ -f "$SA" ] ; then
		NAME=$(awk -F. '{printf ("%s",$1)}' <<< $SA)
                /sbin/asterisk -rx "rpt localplay $NODE1 $NAME"
                /bin/touch $SA
        fi
done


......With this script, you can setup many annoucements, using the naming 
pattern SW*Enabled.ul, so the script won't need adjustment with every 
change. The only place changes are needed is in the rpt.conf file.


......BTW, the -t option in the original "touch -t 0001011111 /tmp/SWAEnabled"
command sets the file's original creation date.  In this case, the 
0001011111  would set the date to: 11:11 AM, Jan 1, 2000.  The reason for 
this was to make the announcement initially run the first time the 
runsched script runs...That isn't really needed, of course; just presented 
as an example.


73, David K4FXC


On Tue, 7 Mar 2023, Earl Hassemer via ARM-allstar wrote:

> Dave
> 
> This looks like it will work now I two more of the same process and I would need to know what I can change to make them work as well, so I can see where I can change the announcement name like what is next.
> 
> /etc/asterisk/local/EmergencyCommunicationsActivation message once every 10 min also once activated with *982 and to deactivate *983
> /etc/asterisk/local/K4HOGDirectedNetAnnouncement message once every 10 min also once activated with *984 and to deactivate *985
> I should be able to copy what you did for the first one and do the same for these two but not sure, it looks like I would need to setup something like runsched1, runsched2, runsched3, change the name under localplay, and then under the rpt.conf DTMF macros 980=cmd I am not sure what the 0001011111 is all about, from there in the crontab I would have to put in three entries I would think to do each runsched.
> 
> Earl
> W9EJH
> _______________________________________________
> 
> ARM-allstar mailing list
> ARM-allstar at hamvoip.org
> http://lists.hamvoip.org/cgi-bin/mailman/listinfo/arm-allstar
> 
> Visit the BBB and RPi2/3/4 web page - http://hamvoip.org
> 



More information about the ARM-allstar mailing list