<div dir="ltr">check the file and group permissions of the script and make sure Asterisk has the OS permissions to run and modify the file.<div><br></div><div><pre style="font-family:monospace,monospace;color:rgb(0,0,0);background-color:rgb(248,249,250);border:1px solid rgb(234,236,240);padding:1em;white-space:pre-wrap;line-height:1.3em;font-size:14px"><span class="gmail-gp" style="color:rgb(0,0,128);font-weight:bold">$</span> ls -l filename.sh
<span class="gmail-go" style="color:rgb(136,136,136)">-rwxr-xr--  1 owner  group</span></pre><pre style="font-family:monospace,monospace;color:rgb(0,0,0);background-color:rgb(248,249,250);border:1px solid rgb(234,236,240);padding:1em;white-space:pre-wrap;line-height:1.3em;font-size:14px"><span class="gmail-go" style="color:rgb(136,136,136)">quick try sudo chmod 777 <filename>  on each file and see if it works for asterisk CLI</span></pre><pre style="font-family:monospace,monospace;color:rgb(0,0,0);background-color:rgb(248,249,250);border:1px solid rgb(234,236,240);padding:1em;white-space:pre-wrap;line-height:1.3em;font-size:14px"></pre><pre style="font-family:monospace,monospace;color:rgb(0,0,0);background-color:rgb(248,249,250);border:1px solid rgb(234,236,240);padding:1em;white-space:pre-wrap;line-height:1.3em;font-size:14px"><span class="gmail-go" style="color:rgb(136,136,136)"> </span></pre></div></div><br><div class="gmail_quote"><div dir="ltr">On Wed, Oct 24, 2018 at 7:44 AM <<a href="mailto:edbathgate@zoominternet.net">edbathgate@zoominternet.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="font-family:times new roman,new york,times,serif;font-size:12pt;color:#000000"><p style="margin:0px">Issuses with running bash scripts from within allstar by DTMF. Host is X86 type,  I'm logged in as root, file permissions set to 777 for both ab.sh and asd.dat. it works from linux cli, partially works from asterisk cli, !/path/script, and does not work from within rpt.conf. 713=cmd,/path/script.   Running asterisk version 0.327 installed about a month ago from iso file.   So story begins...</p><p style="margin:0px"><br></p><p style="margin:0px">This simple script prints 1234, prints the time/date and appends the time and date onto file asd.dat.  </p><p style="margin:0px">/etc/asterisk$ cat script: ab.sh</p><p style="margin:0px">#!/bin/bash<br>echo 1234<br>date<br>date >> asd.dat</p><p style="margin:0px"><br></p><p style="margin:0px">Script runs as it should from the command line of a linux console window<br>/etc/asterisk$ ./ab.sh<br>1234<br>Mon Oct 22 22:05:22 EDT 2018<br>* Note the time ^^^</p><p style="margin:0px"><br></p><p style="margin:0px">Now to check the file and find 05:22:  cat asd.dat</p><p style="margin:0px">Mon Oct 22 22:05:05 EDT 2018<br>Mon Oct 22 22:05:22 EDT 2018  <yay it worked</p><p style="margin:0px"><br></p><p style="margin:0px">But from within Asterisk CLI it only works 1/2 way:<br>*CLI> !/etc/asterisk/ab.sh<br>1234<br>Mon Oct 22 22:11:44 EDT 2018<br>* Note the time ^^^ 6 minutes later, It printed within the asterisk CLI, but did not append to the file.</p><p style="margin:0px">cat asd.dat<br>Mon Oct 22 22:05:05 EDT 2018<br>Mon Oct 22 22:05:22 EDT 2018 < still the old time in the file. not 11:44, so run from asterisk CLI does not let script update the file??</p><p style="margin:0px">And even worse when I try to do this via the rpt.conf file:<br></p><p style="margin:0px"><br></p><p style="margin:0px"><snip> of rpt.conf<br>713 = !/etc/asterisk/ab.sh<br>714 = cmd,/etc/asterisk/ab.sh<br>715 = cmd,/etc/asterisk/nothere.sh</p><p style="margin:0px"><br></p><p style="margin:0px">command 713 does nothing, wrong syntax for rpt.conf but tried as a test anyway.,  714 tries to do something, but does not work., 715 should fail or report error as there is no file by that name but behaves same as 714.<br>n3sdorpt2*CLI> rpt fun 29019 *713<br>n3sdorpt2*CLI> rpt fun 29019 *714<br>[Oct 22 23:32:28] NOTICE[20572]: app_rpt.c:4084 function_cmd: cmd param = /etc/asterisk/ab.sh, digitbuf = <br>n3sdorpt2*CLI> rpt fun 29019 *715<br>[Oct 22 23:33:55] NOTICE[20572]: app_rpt.c:4084 function_cmd: cmd param = /etc/asterisk/nothere.sh, digitbuf =</p><p style="margin:0px"><br></p><p style="margin:0px">I am doing something wrong or have things set wrong in the OS, or is this function been disabled?</p><p style="margin:0px">Please advise.  N3SDO</p><p style="margin:0px"><br></p></div></div>_______________________________________________<br>
App_rpt-users mailing list<br>
<a href="mailto:App_rpt-users@lists.allstarlink.org" target="_blank">App_rpt-users@lists.allstarlink.org</a><br>
<a href="http://lists.allstarlink.org/cgi-bin/mailman/listinfo/app_rpt-users" rel="noreferrer" target="_blank">http://lists.allstarlink.org/cgi-bin/mailman/listinfo/app_rpt-users</a><br>
<br>
To unsubscribe from this list please visit <a href="http://lists.allstarlink.org/cgi-bin/mailman/listinfo/app_rpt-users" rel="noreferrer" target="_blank">http://lists.allstarlink.org/cgi-bin/mailman/listinfo/app_rpt-users</a> and scroll down to the bottom of the page. Enter your email address and press the "Unsubscribe or edit options button"<br>
You do not need a password to unsubscribe, you can do it via email confirmation. If you have trouble unsubscribing, please send a message to the list detailing the problem. <br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><br></div><div dir="ltr"><div>Nathan Hardman</div><div><a href="mailto:nhardman1428@gmail.com" target="_blank">nhardman1428@gmail.com</a></div><a href="mailto:N8THN@ARRL.NET" target="_blank">N8THN@ARRL.NET</a></div><div dir="ltr"><br><div><br></div></div></div></div></div>