Repeater hangs with script

I am somewhat new to allstar and Linux so sorry for the basic questions. I wrote a script that works but at the end if it, the repeater hangs until you key up one extra time.

Basically after the script runs you have to wait about a second and then kurchunk the repeater.

I am sure it something to do with me rebooting the server and the repeaters PTT line being inverted, now how to fix it?

Script below:
#!/bin/bash
sudo sed -i ‘s/unlinkedct=ct1/unlinkedct=ct5/g’ /etc/asterisk/rpt.conf
sudo sed -i ‘s/2700001/180001/g’ /etc/asterisk/rpt.conf
sudo sed -i ‘s+tailmessagelist=/etc/asterisk/sounds/T07,/etc/asterisk/sounds/lark,/etc/asterisk/sounds/T03,/etc/asterisk/sounds/T04,/etc/asterisk/sounds/T05,/etc/asterisk/sounds/T08+tailmessagelist=/etc/asterisk/sounds/wx+g’ /etc/asterisk/rpt.conf
sudo asterisk -rx “rpt reload”
sleep 5
sudo asterisk -rx “rpt localplay 50165 /etc/asterisk/sounds/wx”

the script is called from a touch tone macro and replaces the rotating tail messages with skywarn message and a SW tone to tell users there is a net going on.

Figure out which statement is causing the hang by commenting out each statement one at a time. I’d start with the last asterisk -rx and work up the script until the culprit is uncovered.

One other thing to try is rather than doing asterisk -rx "reload rpt", restart asterisk with astres.sh.

Hi Darrell,

I would recommend separating some of your commands inside of /etc/asterisk/rpt.conf, especially for repeatable items which you might want to call individually later on.

First, let’s say you have ct01 defined as a courtesy tone (and use ctNN as your pattern, where NN is any two digit placeholder), which you’d like to call:

C12301 = cmd,sed -i s/^unlinkedct=ct../unlinkedct\=ct01/g /etc/asterisk/rpt.conf && asterisk -rx rpt reload

Second, let’s say you want to steer down the tail message timer and call a particular message:

C45609 = cmd,sed -i s/^tailmessagetime=.*$/tailmessagetime=120000/g /etc/asterisk/rpt.conf && sed -i s/^tailmessagelist=.*$/tailmessagelist=severe_weather_alert/g /etc/asterisk/rpt.conf && asterisk -rx rpt reload

(And you could, of course, revert back to your defaults…)

C45600 = cmd,sed -i s/^tailmessagetime=.*$/tailmessagetime=900000/g /etc/asterisk/rpt.conf && sed -i s/^tailmessagelist=.*$/tailmessagelist=empty/g /etc/asterisk/rpt.conf && asterisk -rx rpt reload

Lastly, you can bring it all together by calling a macro:

[your_macro_context_goes_here]
101 = *C12301 *C45609#

The sed statements are a little more insular with regular expressions; only un-commented instances are replaced, not all of them in a global fashion, provided you have comments in your file.

I’m doing much of the same thing you’re attempting to do with success thus far.

Best,

John