[arm-allstar] problem running bash script

Doug Crompton wa3dsp at gmail.com
Thu Nov 1 23:13:32 EDT 2018


There should be nothing different when using DTMF with a valid function and
doing it manually. You need to be looking at the client - asterisk -rvvv or
menu item 11.  When you enter the DTMF the decoded digits will display on
the screen and the resulting action based on those digits should display.
If there are errors entering the digits or running the script you will see
them. Some of the scripts you sent do not do anything that you would see
unless you were actually looking at what is does in an ssh window. There
would be no feedback from the DTMF command unless they actually did
something like play the news. It looks like you are doing this but you
always need to specify the full path both in the functions and the scripts.
Also the rm statement probably should be 'rm -f  file'. The test if file
exists, if that is really what you mean is  -e  not  -s  which just tests
if it is not zero length. Let me know what you are seeing in the client at
the repeater.


*73 Doug*

*WA3DSP*

*http://www.crompton.com/hamradio <http://www.crompton.com/hamradio>*

On Thu, Nov 1, 2018 at 10:38 PM "Greyeagle Thornton via ARM-allstar" <
arm-allstar at hamvoip.org> wrote:

> Hi! I guess I made it look like the end goal in my question was to run
> newsline.
> The goal was actually to get ANY bash script to execute from a DTMF command
> on the repeater.
> Two of the files mentioned are shown below:
>
> nonews.sh
> #!/bin/bash
> #if newsenable file exists, delete it and exit
> #if it doesn't exist, just exit
> if [ -s /etc/asterisk/local/playnews/newsenable ] ;
> then sleep .1
> else exit 1
> fi
> rm /etc/asterisk/local/playnews/newsenable
> exit 0
>
> yesnews.sh
> #!/bin/bash
> #if newsenable file exists, just exit
> #if it doesn't exist, copy dummy file to newsenable
> if [ -s /etc/asterisk/local/playnews/newsenable ] ;
> then exit 1
> fi
> cp /etc/asterisk/local/playnews/dummy
> /etc/asterisk/local/playnews/newsenable
> exit 0
>
> I can manually execute these files from putty, and get the expected result.
> (yesnews.sh creates the newsenable file if it's not already there,
> nonews.sh deletes newsenable unless it's already gone, and playnewsline
> disconnects from the East Coast reflector, keeps my two nodes connected
> together, plays newsline in segments until it's done, then reconnects to
> the reflector). Also, playnewsline executes as a cron job every night
> except Tuesday at 9PM unless I have run nonews.sh. So everything works if I
> run them manually from Putty or when the crontab does its thing.
>
> But when I try using DTMF commands on the repeater to execute these files,
> nothing happens.
> _______________________________________________
>
> 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 web page - http://hamvoip.org
>


More information about the ARM-allstar mailing list